Represents a socket-like interface to a TCP/SSL 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 provides access to both readStream
and writeStream
so it can be used with
Pump
to pump data with flow control.
Instances of this class are not thread-safe.
Anything
Object
NetSocket
Basic
Identifiable
Object
Anything
no subtypes hierarchy
Initializer |
NetSocket(NetSocket delegate) |
Attributes | |
localAddress | shared SocketAddress localAddress Return the local address for this socket |
readStream | shared ReadStream readStream |
remoteAddress | shared SocketAddress remoteAddress Return the remote address for this socket |
writeHandlerID | shared String writeHandlerID When a 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. |
writeStream | shared WriteStream writeStream |
Inherited Attributes |
Attributes inherited from: Object hash , string |
Methods | |
close | shared void close() Close the NetSocket |
closeHandler | shared Promise<Anything> closeHandler() Returns a promise that will be resolved when the NetSocket is closed |
sendFile | shared Promise<Anything> sendFile(String fileName) Tell the kernel to stream a file as specified by |
sslUpgrade | shared Promise<Anything> sslUpgrade(void onUpgrade()) Upgrade channel to use SSL/TLS. Be aware that for this to work SSL must be configured. |
write | shared NetSocket write(Chunk chunk) Write a |
Inherited Methods |
Methods inherited from: Object equals |