conduit-extra-1.3.3: Batteries included conduit: adapters for common libraries.

Safe HaskellNone
LanguageHaskell98

Data.Conduit.Network.UDP

Contents

Synopsis

UDP message representation

data Message #

Constructors

Message 

Fields

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 #

Instances
Eq HostPreference 
Instance details

Defined in Data.Streaming.Network.Internal

Ord HostPreference 
Instance details

Defined in Data.Streaming.Network.Internal

Read HostPreference 
Instance details

Defined in Data.Streaming.Network.Internal

Methods

readsPrec :: Int -> ReadS HostPreference

readList :: ReadS [HostPreference]

readPrec :: ReadPrec HostPreference

readListPrec :: ReadPrec [HostPreference]

Show HostPreference 
Instance details

Defined in Data.Streaming.Network.Internal

Methods

showsPrec :: Int -> HostPreference -> ShowS

show :: HostPreference -> String

showList :: [HostPreference] -> ShowS

IsString HostPreference 
Instance details

Defined in Data.Streaming.Network.Internal

Methods

fromString :: String -> HostPreference