Close the NetSocket and notify the handler
when the operation completes.
Close the NetSocket and notify the handler
when the operation completes.
Same as but with an handler
called when the operation completes
Same as but with an handler
called when the operation completes
Calls {@link NetSocket#end}.
Calls {@link NetSocket#end}.
Returns the SNI server name presented during the SSL handshake by the client.
Like {@link NetSocket#localAddress} ()} but returns the server local address when real
is true
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Pipe this ReadStream
to the WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
Like {@link NetSocket#remoteAddress} but returns the proxy remote address when real
is true
Same as {@link NetSocket#sendFile} but also takes a handler that will be called when the send has completed or a failure has occurred
Same as {@link NetSocket#sendFile} but also takes a handler that will be called when the send has completed or a failure has occurred
Same as {@link NetSocket#sendFile} but also takes a handler that will be called when the send has completed or a failure has occurred
Same as {@link NetSocket#sendFile} but also takes a handler that will be called when the send has completed or a failure has occurred
Same as {@link NetSocket#sendFile} but also takes a handler that will be called when the send has completed or a failure has occurred
Same as {@link NetSocket#sendFile} but also takes a handler that will be called when the send has completed or a failure has occurred
Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured.
Same as {@link NetSocket#write} but with an handler
called when the operation completes
Same as {@link NetSocket#write} but with an handler
called when the operation completes
Same as {@link NetSocket#write} but with an handler
called when the operation completes
Same as {@link NetSocket#write} but with an handler
called when the operation completes
Like {@link WriteStream#write} but with an handler
called when the message has been written
or failed to be written.
Like {@link WriteStream#write} but with an handler
called when the message has been written
or failed to be written.
When a NetSocket
is created, it may register an event handler with the event bus, the ID of that
handler is given by writeHandlerID
.
By default, no handler is registered, the feature must be enabled via NetClientOptions or NetServerOptions.
Given this ID, a different event loop can send a buffer to that event handler using the event bus and that buffer will be received by this instance in its own event loop and written to the underlying connection. This allows you to write data to other connections which are owned by different event loops.
This will return true
if there are more bytes in the write queue than the value set using {@link NetSocket#setWriteQueueMaxSize}
Generated using TypeDoc
Represents a socket-like interface to a TCP connection on either the client or the server side.
Instances of this class are created on the client side by an NetClient when a connection to a server is made, or on the server side by a NetServer when a server accepts a connection.
It implements both and so it can be used with Pipe to pipe data with flow control.