Idris2Doc : System.Posix.Socket.Prim

System.Posix.Socket.Prim

(source)

Reexports

importpublic Data.Buffer
importpublic Data.Buffer.Core
importpublic Data.ByteString
importpublic Data.ByteVect
importpublic Data.C.Ptr
importpublic System.Posix.Errno
importpublic System.Posix.File.FileDesc
importpublic System.Posix.File.ReadRes
importpublic System.Posix.Socket.Struct
importpublic System.Posix.Socket.Types

Definitions

socket : (d : Domain) ->SockType->EPrim (Socketd)
  Creates a new endpoint for communication returning a file descriptor
referring to that endpoint.

Totality: total
Visibility: export
listen : Socketd->Bits32->EPrim ()
  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`.

Totality: total
Visibility: export
accept : Socketd->EPrim (Socketd)
  Accept connections on a socket.

Incoming connections are returned as new `Socket` file descriptors.

Totality: total
Visibility: export
bind_ : Socketd->Sockaddrd->EPrim ()
  Binds a socket to the given address. See also `bind` for a more
convenient version of this function.

Totality: total
Visibility: export
connect_ : Socketd->Sockaddrd->EPrim ()
  Connects a socket to the given address. See also `connect` for a more
convenient version of this function.

Totality: total
Visibility: export
recvPtr : Socketd-> (0r : Type) ->FromPtrr=>CPtr->SockFlags->EPrim (ReadResr)
  Reads at most `n` bytes from a file into an allocated pointer.

Totality: total
Visibility: export
recv : Socketd-> (0r : Type) ->FromBufr=>Bits32->SockFlags->EPrim (ReadResr)
  Reads at most `n` bytes from a file into a bytestring.

Totality: total
Visibility: export
recvFromPtr : Socketd-> (0r : Type) ->FromPtrr=>CPtr->SockFlags->Sockaddrd->EPrimr
  Reads at most `n` bytes from a file into an allocated pointer.

Totality: total
Visibility: export
recvFrom : Socketd-> (0r : Type) ->FromBufr=>Bits32->SockFlags->Sockaddrd->EPrimr
  Reads at most `n` bytes from a file into an allocated pointer.

Totality: total
Visibility: export
sendto : ToBufr=>Socketd->r->SockFlags->Sockaddrd->EPrimBits32
  Sends the given byte string via the given socket to the peer at the
given address.

Totality: total
Visibility: export
bind : Socketd->Addrd->EPrim ()
  Convenience alias for `bind_`.

Totality: total
Visibility: export
connect : Socketd->Addrd->EPrim ()
  Convenience alias for `connect_`.

Totality: total
Visibility: export
getpeername_ : Socketd->Sockaddrd->EPrim ()
  Returns the address of the peer connected to a socket.
The given Sockaddr buffer will be filled with the peer address.

Totality: total
Visibility: export
getsockname_ : Socketd->Sockaddrd->EPrim ()
  Returns the current address to which the socket is bound.
The given Sockaddr buffer will be filled with the socket's address.

Totality: total
Visibility: export
getpeername : Socketd->EPrim (Addrd)
  Returns the address of the peer connected to a socket.

Totality: total
Visibility: export
getsockname : Socketd->EPrim (Addrd)
  Returns the current address to which the socket is bound.

Totality: total
Visibility: export
setNoDelay : Socketd->Bool->EPrim ()
  Enables or disables the Nagle algorithm.

Totality: total
Visibility: export
setReuseAddress : Socketd->Bool->EPrim ()
  Allows binding to an address/port before the expiry of the TIME_WAIT state.

Totality: total
Visibility: export
setLinger : Socketd->MaybeBits32->EPrim ()
  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.

Totality: total
Visibility: export