Support for defining custom transport mechanisms. Most users will not need to care about the types defined in this module.
- class Transport t where
- class Transport t => TransportOpen t where
- class Transport t => TransportListen t where
- data TransportListener t :: *
- transportListen :: TransportOptions t -> Address -> IO (TransportListener t)
- transportAccept :: TransportListener t -> IO t
- transportListenerClose :: TransportListener t -> IO ()
- transportListenerAddress :: TransportListener t -> Address
- transportListenerUUID :: TransportListener t -> UUID
- data TransportError
- transportError :: String -> TransportError
- transportErrorMessage :: TransportError -> String
- transportErrorAddress :: TransportError -> Maybe Address
- data SocketTransport
- socketTransportOptionBacklog :: TransportOptions SocketTransport -> Int
- socketTransportCredentials :: SocketTransport -> IO (CUInt, CUInt, CUInt)
Transport can exchange bytes with a remote peer.
Additional options that this transport type may use when establishing a connection.
Default values for this transport's options.
ByteString of the given size from the transport. The
transport should block until sufficient bytes are available, and
only return fewer than the requested amount if there will not be
any more data.
TransportError if an error occurs.
Close an open transport, and release any associated resources or handles.
Transport which can open a connection to a remote peer.
Open a connection to the given address, using the given options.
TransportError if the connection could not be
Transport which can listen for and accept connections from remote
Begin listening for connections on the given address, using the given options.
TransportError if it's not possible to listen at that
address (for example, if the port is already in use).
Accept a new connection.
TransportError if some error happens before the
transport is ready to exchange bytes.
Close an open listener.
Get the address to use to connect to a listener.
Get the UUID allocated to this transport listener.
Thrown from transport methods when an error occurs.
Supports connecting over Unix or TCP sockets.
Unix sockets are similar to pipes, but exist as special files in the filesystem. On Linux, abstract sockets have a path-like address, but do not actually have entries in the filesystem.
TCP sockets may use either IPv4 or IPv6.