Documentation

Std.Http.Transport

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 : αUInt64Async.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 ByteArrayAsync.Async Unit

    Send all data through the client connection.

  • recvSelector : αUInt64Async.Selector (Option ByteArray)

    Get a selector for receiving data asynchronously.

  • close : αIO Unit

    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

    Mock client endpoint for testing.

    Instances For

      Mock server endpoint for testing.

      Instances For

        Creates a mock server and client that are connected to each other and share the same underlying state, enabling bidirectional communication.

        Instances For

          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

                          Tries to receive data without blocking, joining all immediately available chunks. Returns none if no data is available.

                          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

                                      Tries to receive data without blocking, joining all immediately available chunks. Returns none if no data is available.

                                      Instances For

                                        Closes the mock server and client.

                                        Instances For