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

Safe Haskell | None
Language | Haskell98

Data.Streaming.Network.Internal

Synopsis

- data ServerSettings = ServerSettings {
  - serverPort :: !Int
  - serverHost :: !HostPreference
  - serverSocket :: !(Maybe Socket)
  - serverAfterBind :: !(Socket -> IO ())
  - serverNeedLocalAddr :: !Bool
  - serverReadBufferSize :: !Int
  }
- data ClientSettings = ClientSettings {
  - clientPort :: !Int
  - clientHost :: !ByteString
  - clientAddrFamily :: !Family
  - clientReadBufferSize :: !Int
  }
- data HostPreference
  - = HostAny
  - | HostIPv4
  - | HostIPv4Only
  - | HostIPv6
  - | HostIPv6Only
  - | Host String
- data Message = Message {
  - msgData :: !ByteString
  - msgSender :: !SockAddr
  }
- data AppData = AppData {
  - appRead' :: !(IO ByteString)
  - appWrite' :: !(ByteString -> IO ())
  - appSockAddr' :: !SockAddr
  - appLocalAddr' :: !(Maybe SockAddr)
  - appCloseConnection' :: !(IO ())
  - appRawSocket' :: Maybe Socket
  }
- data ServerSettingsUnix = ServerSettingsUnix {
  - serverPath :: !FilePath
  - serverAfterBindUnix :: !(Socket -> IO ())
  - serverReadBufferSizeUnix :: !Int
  }
- data ClientSettingsUnix = ClientSettingsUnix {
  - clientPath :: !FilePath
  - clientReadBufferSizeUnix :: !Int
  }
- data AppDataUnix = AppDataUnix {
  - appReadUnix :: !(IO ByteString)
  - appWriteUnix :: !(ByteString -> IO ())
  }

# 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

Instances

HasReadBufferSize ServerSettings | Since 0.1.13
HasAfterBind ServerSettings |
HasPort ServerSettings |

data ClientSettings

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

Constructors

ClientSettings |
Fields clientPort :: !Int clientHost :: !ByteString clientAddrFamily :: !Family clientReadBufferSize :: !Int

Instances

HasReadBufferSize ClientSettings | Since 0.1.13
HasPort ClientSettings |

data HostPreference

Which host to bind.

Note: The `IsString` instance recognizes the following special values:

- `*` means `HostAny`
- `*4` means `HostIPv4`
- `!4` means `HostIPv4Only`
- `*6` means `HostIPv6`
- `!6` means `HostIPv6Only`

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

Constructors

HostAny |
HostIPv4 |
HostIPv4Only |
HostIPv6 |
HostIPv6Only |
Host String |

Instances

Eq HostPreference |
Ord HostPreference |
Read HostPreference |
Show HostPreference |
IsString HostPreference |

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

Instances

HasReadWrite AppData |

data ServerSettingsUnix

Settings for a Unix domain sockets server.

Constructors

ServerSettingsUnix |
Fields serverPath :: !FilePath serverAfterBindUnix :: !(Socket -> IO ()) serverReadBufferSizeUnix :: !Int

Instances

HasReadBufferSize ServerSettingsUnix | Since 0.1.13
HasAfterBind ServerSettingsUnix |
HasPath ServerSettingsUnix |

data ClientSettingsUnix

Settings for a Unix domain sockets client.

Constructors

ClientSettingsUnix |
Fields clientPath :: !FilePath clientReadBufferSizeUnix :: !Int

Instances

HasReadBufferSize ClientSettingsUnix | Since 0.1.14
HasPath ClientSettingsUnix |

data AppDataUnix

The data passed to a Unix domain sockets `Application`.

Constructors

AppDataUnix |
Fields appReadUnix :: !(IO ByteString) appWriteUnix :: !(ByteString -> IO ())

Instances

HasReadWrite AppDataUnix |