Documentation

Std.Internal.UV.TCP

@[extern lean_uv_tcp_new]

Creates a new TCP socket.

@[extern lean_uv_tcp_connect]

Connects a TCP socket to the specified address.

@[extern lean_uv_tcp_send]

Sends data through a TCP socket.

@[extern lean_uv_tcp_recv]

Receives data from a TCP socket with a maximum size of size bytes. The promise resolves when data is available or an error occurs. 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.

@[extern lean_uv_tcp_bind]

Binds a TCP socket to a specific address.

@[extern lean_uv_tcp_listen]
opaque Std.Internal.UV.TCP.Socket.listen (socket : Socket) (backlog : UInt32) :

Starts listening for incoming connections on a TCP socket.

@[extern lean_uv_tcp_accept]

Accepts an incoming connection on a listening TCP socket.

@[extern lean_uv_tcp_shutdown]

Shuts down an incoming connection on a listening TCP socket.

@[extern lean_uv_tcp_getpeername]

Gets the remote address of a connected TCP socket.

@[extern lean_uv_tcp_getsockname]

Gets the local address of a bound TCP socket.

@[extern lean_uv_tcp_nodelay]

Enables the Nagle algorithm for a TCP socket.

@[extern lean_uv_tcp_keepalive]
opaque Std.Internal.UV.TCP.Socket.keepAlive (socket : Socket) (enable : Int8) (delay : UInt32) :

Enables TCP keep-alive for a socket. If delay is less than 1 then UV_EINVAL is returned.