Create and initialize a new wrapped uv_tcp_t
handle.
Readable property exposing the address of the peer connected to the handle.
Wraps uv_tcp_getpeername
.
Readable property exposing the current address to which the handle is bound
Wraps uv_tcp_getsockname
.
This call is used in conjunction with Stream.listen to accept incoming connections. Call this function after receiving a connection callback to accept the connection.
Wraps uv_accept
.
Bind the handle to an address and port.
Wraps uv_tcp_bind
.
Request handle to be closed.
Wrapper for uv_close
.
Establish an IPv4 or IPv6 TCP connection.
Wraps uv_tcp_connect
.
Returns true
if the handle referenced, false
otherwise.
Wrapper for uv_has_ref
.
Start listening for incoming connections.
server.listen(backlog, (error) => {
...
const client = new Tcp();
server.accept(client)
...
});
Wraps uv_listen
.
indicates the number of connections the kernel might queue.
is called when a new incoming connection is received.
Read data from an incoming stream.
will be called several times until there is no more data to read or Stream.readStop is called.
Wraps uv_read_start
.
Stop reading data from the stream. The Stream.readStart callback will no longer be called.
Wraps uv_read_stop
.
Reference the handle.
Wrapper for uv_ref
.
Shutdown the outgoing (write) side of a duplex stream.
Wraps uv_shutdown
.
Un-reference the handle.
Wrapper for uv_unref
.
Write data to stream. Buffers are written in order.
stream.write(new Write(), data, (error) => {
print('The data was written...');
});
Wraps uv_write
.
Generated using TypeDoc
TCP handles are used to represent both TCP streams and servers.
Wrapper for
uv_tcp_t
. See http://docs.libuv.org/en/v1.x/tcp.html