socket : Has Errno es => EIO1 f => (d : Domain) -> SockType -> f es (Socket d) Creates a new endpoint for communication returning a file descriptor
referring to that endpoint.
Visibility: exportlisten : Has Errno es => EIO1 f => Socket d -> Bits32 -> f es () Listen for connections on a socket.
This marks the socket as the *passive* part that will then wait
for incoming connections using calles to `accept`.
Visibility: exportaccept : Has Errno es => EIO1 f => Socket d -> f es (Socket d) Accept connections on a socket.
Incoming connections are returned as new `Socket` file descriptors.
Visibility: exportbind_ : Has Errno es => EIO1 f => Socket d -> Sockaddr d -> f es () Binds a socket to the given address.
Visibility: exportconnect_ : Has Errno es => EIO1 f => Socket d -> Sockaddr d -> f es () Connects a socket to the given address.
Visibility: exportbind : Has Errno es => EIO1 f => Socket d -> Addr d -> f es () Convenience alias for `bind_`.
Visibility: exportconnect : Has Errno es => EIO1 f => Socket d -> Addr d -> f es () Convenience alias for `connect_`.
Visibility: exportrecvPtr : Has Errno es => EIO1 f => Socket d -> (0 r : Type) -> FromPtr r => CPtr -> SockFlags -> f es (ReadRes r) Reads at most `n` bytes from a file into an allocated pointer.
Visibility: exportrecvFromPtr : Has Errno es => EIO1 f => Socket d -> (0 r : Type) -> FromPtr r => CPtr -> SockFlags -> Sockaddr d -> f es r Reads at most `n` bytes from a file into an allocated pointer.
Visibility: exportrecv : Has Errno es => EIO1 f => Socket d -> (0 r : Type) -> FromBuf r => Bits32 -> SockFlags -> f es (ReadRes r) Reads at most `n` bytes from a file into a bytestring.
Visibility: exportrecvFrom : Has Errno es => EIO1 f => Socket d -> (0 r : Type) -> FromBuf r => Bits32 -> SockFlags -> Sockaddr d -> f es r Reads at most `n` bytes from a socket into a bytestring
Visibility: exportsendto : Has Errno es => EIO1 f => ToBuf r => Socket d -> r -> SockFlags -> Sockaddr d -> f es Bits32- Visibility: export
getpeername_ : Has Errno es => EIO1 f => Socket d -> Sockaddr d -> f es () Returns the address of the peer connected to a socket.
The given Sockaddr buffer will be filled with the peer address.
Visibility: exportgetsockname_ : Has Errno es => EIO1 f => Socket d -> Sockaddr d -> f es () Returns the current address to which the socket is bound.
The given Sockaddr buffer will be filled with the socket's address.
Visibility: exportgetpeername : Has Errno es => EIO1 f => Socket d -> f es (Addr d) Returns the address of the peer connected to a socket.
Visibility: exportgetsockname : Has Errno es => EIO1 f => Socket d -> f es (Addr d)- Visibility: export
setNoDelay : Has Errno es => EIO1 f => Socket d -> Bool -> f es () Enables or disables the Nagle algorithm.
Visibility: exportsetReuseAddress : Has Errno es => EIO1 f => Socket d -> Bool -> f es () Allows binding to an address/port before the expiry of the TIME_WAIT state.
Visibility: exportsetLinger : Has Errno es => EIO1 f => Socket d -> Maybe Bits32 -> f es () Sets the linger option for a socket.
`Nothing` disables lingering (close returns immediately).
`Just 0` enables a hard close (RST sent, data discarded).
`Just n` for n > 0 waits up to n seconds for data to be sent before closing.
Visibility: export