Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.Conduit.Network.UDP
Synopsis
- data Message = Message {}
- sourceSocket :: MonadIO m => Socket -> Int -> ConduitT i Message m ()
- sinkSocket :: MonadIO m => Socket -> ConduitT ByteString o m ()
- sinkAllSocket :: MonadIO m => Socket -> ConduitT ByteString o m ()
- sinkToSocket :: MonadIO m => Socket -> ConduitT Message o m ()
- sinkAllToSocket :: MonadIO m => Socket -> ConduitT Message o m ()
- data HostPreference
UDP message representation
Basic utilities
sourceSocket :: MonadIO m => Socket -> Int -> ConduitT i Message m () Source #
Stream messages from the socket.
The given len
defines the maximum packet size. Every produced item
contains the message payload and the origin address.
This function does not automatically close the socket.
sinkSocket :: MonadIO m => Socket -> ConduitT ByteString o m () Source #
Stream messages to the connected socket.
The payload is sent using send
, so some of it might be lost.
This function does not automatically close the socket.
sinkAllSocket :: MonadIO m => Socket -> ConduitT ByteString o m () Source #
Stream messages to the connected socket.
The payload is sent using sendAll
, so it might end up in multiple packets.
This function does not automatically close the socket.
sinkToSocket :: MonadIO m => Socket -> ConduitT Message o m () Source #
Stream messages to the socket.
Every handled item contains the message payload and the destination
address. The payload is sent using sendTo
, so some of it might be
lost.
This function does not automatically close the socket.
sinkAllToSocket :: MonadIO m => Socket -> ConduitT Message o m () Source #
Stream messages to the socket.
Every handled item contains the message payload and the destination
address. The payload is sent using sendAllTo
, so it might end up in
multiple packets.
This function does not automatically close the socket.
Helper Utilities
data HostPreference #