Initiate a connection on a given socket.
This function is asynchronous. When the connection is established, the 'connect' event will be emitted. However, connect() will throw error synchronously if the 'serverPath' is not a valid Seqpacket server.
Ensures that no more I/O activity happens on this socket. Destroys the stream and closes the connection.
Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data.
Return the size of buffer that SeqpacketSocket uses to receive data. The data will be truncated if the buffer size is not large enough.
Default size is 256KB.
Reference the socket so that it will prevent Node.js process from exiting automatically.
Set the size of buffer that SeqpacketSocket uses to receive data.
Unreference the socket so that it won't prevent Node.js process from exiting automatically.
Sends data on the socket. The cb
is called when data is written to operating system.
Generated using TypeDoc
SeqpacketSocket is an abstraction of a SOCK_SEQPACKET socket.
SeqpacketSocket is also an
EventEmitter
and will emit events including:Event:
'connect'
Emitted when a socket connection is successfully established.
Event:
'data'
Buffer
Emitted when data is received. All message boundaries in incoming datagrams are preserved.Event:
'end'
Emitted when the other end of the socket signals the end of transmission, thus ending the readable side of the socket.
Event:
'error'
Error
Emitted when an error occurs. The 'close' event will be called directly following this event.Event:
'close'
Emitted once the socket is fully closed.