Low-Level C Sockets bindings for Idris. Used by higher-level, cleverer things.
Type-unsafe parts. Use Network.Socket for a safe variant.
Original (C) SimonJF, MIT Licensed, 2014
Modified (C) The Idris Community, 2015, 2016
Frees a given pointer
Allocates an amount of memory given by the ByteLength parameter.
Used to allocate a mutable pointer to be given to the Recv functions.
Send a message stored in some buffer.
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.
A Pointer to the buffer containing the message.
The size of the message.
Sends the data in a given memory location
Returns on failure a SocketError
Returns on success the ResultCode
The socket on which to send the message.
The location containing the data to send.
How much of the data to send.
Receive a message placed on a 'known' buffer.
Returns on failure a SocketError
.
Returns on success a pair of
UDPAddrInfo
:: The address of the sender.Int
:: Result value from underlying function.The channel on which to receive.
Pointer to the buffer to place the message.
Size of the expected message.
Receive data from a given memory location.
Returns on failure a SocketError
Returns on success the ResultCode
The socket on which to receive the message.
The location containing the data to receive.
How much of the data to receive.
Retrieves a socket address from a sockaddr pointer
Utility to extract data.
Utility function to return sender's IPV4 port.
Utility function to get the payload of the sent message as a String
.
Utility function to return senders socket address.