Idris2Doc : Network.Socket.Raw

Network.Socket.Raw

BufPtr : Type
Totality: total
Constructor: 
BPtr : AnyPtr -> BufPtr
RecvStructPtr : Type
Totality: total
Constructor: 
RSPtr : AnyPtr -> RecvStructPtr
RecvfromStructPtr : Type
Totality: total
Constructor: 
RFPtr : AnyPtr -> RecvfromStructPtr
SockaddrPtr : Type
Totality: total
Constructor: 
SAPtr : AnyPtr -> SockaddrPtr
foreignGetRecvfromAddr : HasIOio => RecvfromStructPtr -> ioSocketAddress
Utility function to return senders socket address.
foreignGetRecvfromPayload : HasIOio => RecvfromStructPtr -> io String
Utility function to get the payload of the sent message as a `String`.
foreignGetRecvfromPort : HasIOio => RecvfromStructPtr -> ioPort
Utility function to return sender's IPV4 port.
freeRecvStruct : HasIOio => RecvStructPtr -> ioUnit
freeRecvfromStruct : HasIOio => RecvfromStructPtr -> ioUnit
Utility to extract data.
getSockAddr : HasIOio => SockaddrPtr -> ioSocketAddress
Retrieves a socket address from a sockaddr pointer
getSockPort : HasIOio => Socket -> ioPort
Retrieves the port the given socket is bound to
recvBuf : HasIOio => Socket -> BufPtr -> ByteLength -> io (EitherSocketErrorResultCode)
Receive data from a given memory location.

Returns on failure a `SocketError`
Returns on success the `ResultCode`

@sock The socket on which to receive the message.
@ptr The location containing the data to receive.
@len How much of the data to receive.
recvFromBuf : HasIOio => Socket -> BufPtr -> ByteLength -> io (EitherSocketError (UDPAddrInfo, ResultCode))
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.

@sock The channel on which to receive.
@ptr Pointer to the buffer to place the message.
@len Size of the expected message.

sendBuf : HasIOio => Socket -> BufPtr -> ByteLength -> io (EitherSocketErrorResultCode)
Sends the data in a given memory location

Returns on failure a `SocketError`
Returns on success the `ResultCode`

@sock The socket on which to send the message.
@ptr The location containing the data to send.
@len How much of the data to send.
sendToBuf : HasIOio => Socket -> SocketAddress -> Port -> BufPtr -> ByteLength -> io (EitherSocketErrorResultCode)
Send a message stored in some buffer.

Returns on failure a `SocketError`
Returns on success the `ResultCode`

@sock The socket on which to send the message.
@addr Address of the recipient.
@port The port on which to send the message.
@ptr A Pointer to the buffer containing the message.
@len The size of the message.
sock_alloc : HasIOio => ByteLength -> ioBufPtr
Allocates an amount of memory given by the ByteLength parameter.

Used to allocate a mutable pointer to be given to the Recv functions.
sock_free : HasIOio => BufPtr -> ioUnit
Frees a given pointer
sock_peek : HasIOio => BufPtr -> Int -> io Int
Take a value from a buffer
sock_poke : HasIOio => BufPtr -> Int -> Int -> ioUnit
Put a value in a buffer
sockaddr_free : HasIOio => SockaddrPtr -> ioUnit