streaming-commons-0.1.15.5: Common lower-level functions needed by various streaming data libraries

Safe HaskellNone
LanguageHaskell98

Data.Streaming.Network.Internal

Synopsis

Documentation

data ServerSettings

Settings for a TCP server. It takes a port to listen on, and an optional hostname to bind to.

Constructors

ServerSettings 

Fields

serverPort :: !Int
 
serverHost :: !HostPreference
 
serverSocket :: !(Maybe Socket)

listening socket

serverAfterBind :: !(Socket -> IO ())
 
serverNeedLocalAddr :: !Bool
 
serverReadBufferSize :: !Int
 

data ClientSettings

Settings for a TCP client, specifying how to connect to the server.

data HostPreference

Which host to bind.

Note: The IsString instance recognizes the following special values:

  • * means HostAny - "any IPv4 or IPv6 hostname"
  • *4 means HostIPv4 - "any IPv4 or IPv6 hostname, IPv4 preferred"
  • !4 means HostIPv4Only - "any IPv4 hostname"
  • *6 means HostIPv6@ - "any IPv4 or IPv6 hostname, IPv6 preferred"
  • !6 means HostIPv6Only - "any IPv6 hostname"

Note that the permissive * values allow binding to an IPv4 or an IPv6 hostname, which means you might be able to successfully bind to a port more times than you expect (eg once on the IPv4 localhost 127.0.0.1 and again on the IPv6 localhost 0:0:0:0:0:0:0:1).

Any other value is treated as a hostname. As an example, to bind to the IPv4 local host only, use "127.0.0.1".

data Message

Representation of a single UDP message

Constructors

Message 

Fields

msgData :: !ByteString
 
msgSender :: !SockAddr
 

data AppData

The data passed to an Application.

Constructors

AppData 

Fields

appRead' :: !(IO ByteString)
 
appWrite' :: !(ByteString -> IO ())
 
appSockAddr' :: !SockAddr
 
appLocalAddr' :: !(Maybe SockAddr)
 
appCloseConnection' :: !(IO ())
 
appRawSocket' :: Maybe Socket
 

data ServerSettingsUnix

Settings for a Unix domain sockets server.

Constructors

ServerSettingsUnix 

data ClientSettingsUnix

Settings for a Unix domain sockets client.

data AppDataUnix

The data passed to a Unix domain sockets Application.

Constructors

AppDataUnix 

Fields

appReadUnix :: !(IO ByteString)
 
appWriteUnix :: !(ByteString -> IO ())