Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- send :: TVar Bool -> Socket Connected a -> MutableBytes RealWorld -> IO (Either (SendException Interruptible) ())
- sendToIPv4 :: TVar Bool -> Socket Unconnected (Internet V4) -> Peer -> MutableBytes RealWorld -> IO (Either (SendException Interruptible) ())
- receive :: TVar Bool -> Socket c a -> MutableBytes RealWorld -> IO (Either (ReceiveException Interruptible) Int)
- receiveFromIPv4 :: TVar Bool -> Socket Unconnected (Internet V4) -> MutableBytes RealWorld -> MutablePrimArrayOffset RealWorld SocketAddressInternet -> IO (Either (ReceiveException Interruptible) Int)
- receiveMany :: TVar Bool -> Socket c a -> PeerlessSlab -> IO (Either (ReceiveException Interruptible) Int)
- receiveManyFromIPv4 :: TVar Bool -> Socket Unconnected (Internet V4) -> IPv4Slab -> IO (Either (ReceiveException Interruptible) Int)
Send
:: TVar Bool | Interrupt. On |
-> Socket Connected a | Socket with designated peer |
-> MutableBytes RealWorld | Slice of a buffer |
-> IO (Either (SendException Interruptible) ()) |
Send a datagram using a socket with a pre-designated peer. This refers
to a datagram socket for which POSIX connect
has locked down communication
to an individual peer.
Receive
:: TVar Bool | Interrupt. On |
-> Socket c a | Socket |
-> MutableBytes RealWorld | Slice of a buffer |
-> IO (Either (ReceiveException Interruptible) Int) |
Receive a datagram, discarding the peer address. This can be used with datagram sockets of any family. It is usable with both connected and unconnected datagram sockets.
:: TVar Bool | Interrupt. On |
-> Socket Unconnected (Internet V4) | IPv4 socket without designated peer |
-> MutableBytes RealWorld | Slice of a buffer |
-> MutablePrimArrayOffset RealWorld SocketAddressInternet | Buffer for returned peer address |
-> IO (Either (ReceiveException Interruptible) Int) |
Receive Many
:: TVar Bool | Interrupt. On |
-> Socket c a | Socket |
-> PeerlessSlab | Buffers into which sizes and payloads are received |
-> IO (Either (ReceiveException Interruptible) Int) |
Receive up to the specified number of datagrams into freshly allocated
byte arrays. When there are many datagrams present in the receive
buffer, this is more efficient than calling receive
repeatedly. This
is guaranteed to fill the buffer with at least one message.
The length buffer and the payload buffers arrange data in a
structure-of-arrays fashion. The size of the payload received
into payloads[j]
is stored at lengths[j]
.
:: TVar Bool | Interrupt. On |
-> Socket Unconnected (Internet V4) | Socket |
-> IPv4Slab | Buffers into which sizes, addresses, and payloads are received |
-> IO (Either (ReceiveException Interruptible) Int) |
Variant of receiveMany
that provides that source address
corresponding to each datagram. This introduces another array
to the structure-of-arrays.