Represents a TCP server socket, managing incoming client connections.
- ofNative :: (
- native : UV.TCP.Socket
- )
Represents a TCP client socket, used to connect to a server.
- ofNative :: (
- native : UV.TCP.Socket
- )
Creates a new TCP server socket.
Equations
- Std.Internal.IO.Async.TCP.Socket.Server.mk = do let native ← Std.Internal.UV.TCP.Socket.new pure { native := native }
Binds the server socket to the specified address. Address reuse is enabled to allow rebinding the same address.
Gets the local address of the server socket.
Equations
Enables TCP keep-alive for all client sockets accepted by this server socket.
Creates a new TCP client socket.
Equations
- Std.Internal.IO.Async.TCP.Socket.Client.mk = do let native ← Std.Internal.UV.TCP.Socket.new pure { native := native }
Binds the server socket to the specified address. Address reuse is enabled to allow rebinding the same address.
Connects the client socket to the given address.
Receives data from the client socket. If data is received, it’s wrapped in .some. If EOF is reached, the result is .none, indicating no more data is available. Receiving data in parallel on the same socket is not supported. Instead, we recommend binding multiple sockets to the same address.
Gets the remote address of the client socket.
Equations
Gets the local address of the client socket.
Equations
Enables TCP keep-alive with a specified delay for the client socket.