Low-Level C Sockets bindings for Idris. Used by higher-level, cleverer things.
Original (C) SimonJF, MIT Licensed, 2014
Modified (C) The Idris Community, 2015, 2016
Creates a UNIX socket with the given family, socket type and protocol
number. Returns either a socket or an error.
Send a message.
Returns on failure a SocketError
Returns on success the ResultCode
The socket on which to send the message.
Address of the recipient.
The port on which to send the message.
The message to send.
Send data on the specified socket.
Returns on failure a SocketError
.
Returns on success the ResultCode
.
The socket on which to send the message.
The data to send.
Receive a message.
Returns on failure a SocketError
.
Returns on success a triple of
UDPAddrInfo
:: The address of the sender.String
:: The payload.Int
:: Result value from underlying function.The channel on which to receive.
Size of the expected message.
Receive all the remaining data on the specified socket.
Returns on failure a SocketError
Returns on success the payload String
The socket on which to receive the message.
Receive data on the specified socket.
Returns on failure a SocketError
Returns on success a pairing of:
String
:: The payload.ResultCode
:: The result of the underlying function.The socket on which to receive the message.
How much of the data to receive.
Listens on a bound socket.
The socket to listen on.
Connects to a given address and port.
Returns 0 on success, and an error number on error.
Close a socket
Binds a socket to the given socket address and port.
Returns 0 on success, an error code otherwise.
Accept a connection on the provided socket.
Returns on failure a SocketError
Returns on success a pairing of:
Socket
:: The socket representing the connection.SocketAddress
:: TheThe socket used to establish connection.