Idris2Doc : System.Posix.Socket

System.Posix.Socket

(source)

Reexports

import public System.Posix.Socket.Struct
import public System.Posix.Socket.Types
import public System.Posix.File.ReadRes

Definitions

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: export
listen : 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: export
accept : 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: export
bind_ : Has Errno es => EIO1 f => Socket d -> Sockaddr d -> f es ()
  Binds a socket to the given address.

Visibility: export
connect_ : Has Errno es => EIO1 f => Socket d -> Sockaddr d -> f es ()
  Connects a socket to the given address.

Visibility: export
bind : Has Errno es => EIO1 f => Socket d -> Addr d -> f es ()
  Convenience alias for `bind_`.

Visibility: export
connect : Has Errno es => EIO1 f => Socket d -> Addr d -> f es ()
  Convenience alias for `connect_`.

Visibility: export
recvPtr : 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: export
recvFromPtr : 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: export
recv : 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: export
recvFrom : 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: export
sendto : 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: export
getsockname_ : 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: export
getpeername : Has Errno es => EIO1 f => Socket d -> f es (Addr d)
  Returns the address of the peer connected to a socket.

Visibility: export
getsockname : 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: export
setReuseAddress : 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: export
setLinger : 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