Luv.TCPSourceTCP sockets.
See TCP in the user guide and uv_tcp_t — TCP handle in libuv.
Binds uv_tcp_t.
Note that values of this type can also be used with functions in:
In particular, see Luv.Handle.close, Luv.Stream.accept, Luv.Stream.read_start, Luv.Stream.write.
val init :
?loop:Loop.t ->
?domain:Sockaddr.Address_family.t ->
unit ->
(t, Error.t) Result.resultAllocates and initializes a TCP stream.
Binds uv_tcp_init_ex.
The stream is not yet connected or listening. See Luv.TCP.bind, Luv.Stream.listen, and Luv.Stream.connect.
On libuv prior to 1.7.0, using ?domain causes this function to return Error `ENOSYS ("Function not implemented").
Feature check: Luv.Require.(has tcp_init_ex)
Wraps an existing socket in a libuv TCP stream.
Binds uv_tcp_open.
Binds UV_NONBLOCK_PIPE.
val socketpair :
?fst_flags:Flag.t list ->
?snd_flags:Flag.t list ->
Sockaddr.Socket_type.t ->
int ->
(Os_fd.Socket.t * Os_fd.Socket.t, Error.t) Result.resultCreates a pair of connected sockets.
Binds uv_socketpair. See socketpair(3p).
See Luv.Pipe.pipe for an explanation of the optional arguments.
The integer argument is the protocol number.
Requires Luv 0.5.7 and libuv 1.41.0.
Feature check: Luv.Require.(has socketpair)
Sets TCP_NODELAY.
Binds uv_tcp_nodelay.
Sets the TCP keepalive.
Binds uv_tcp_keepalive.
Sets simultaneous accept.
Binds uv_tcp_simultaneous_accepts.
Assigns an address to the given TCP socket.
Binds uv_tcp_bind. See bind(3p).
Retrieves the address assigned to the given TCP socket.
Binds uv_tcp_getsockname. See getsockname(3p).
Retrieves the address of the given TCP socket's peer.
Binds uv_tcp_getpeername. See getpeername(3p).
Connects to a host.
Binds uv_tcp_connect. See connect(3p).
Resets the connection.
Binds uv_tcp_close_reset.