Transport #
This module exposes a Transport type class that is used to represent different transport mechanisms
that can be used with an HTTP connection.
Generic HTTP interface that abstracts over different transport mechanisms.
- recv : α → UInt64 → Async.Async (Option ByteArray)
Receive data from the client connection, up to the expected size. Returns None if the connection is closed or no data is available.
- sendAll : α → Array ByteArray → Async.Async Unit
Send all data through the client connection.
- recvSelector : α → UInt64 → Async.Selector (Option ByteArray)
Get a selector for receiving data asynchronously.
Close the transport connection. The default implementation is a no-op; override this for transports that require explicit teardown. For
Socket.Client, the runtime closes the file descriptor when the object is finalized.
Instances
Receives data from a channel, joining all available data up to the expected size. First does a
blocking recv, then greedily consumes available data with tryRecv until expect bytes are reached.
Instances For
Sends a single ByteArray through a channel.
Instances For
Sends ByteArrays through a channel.
Instances For
Creates a selector for receiving from a channel.
Instances For
Gets the receive channel for a client (server to client direction).
Instances For
Gets the send channel for a client (client to server direction).
Instances For
Sends a single ByteArray.
Instances For
Receives data, joining all available chunks.
Instances For
Closes the mock server and client.
Instances For
Gets the receive channel for a server (client to server direction).
Instances For
Gets the send channel for a server (server to client direction).
Instances For
Sends a single ByteArray.
Instances For
Receives data, joining all available chunks.
Instances For
Closes the mock server and client.