Skip to main content

end

method Socket.prototype.end
Jump to headingSocket.prototype.end(callback?: () => void): this

Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data.

See writable.end() for further details.

Parameters Jump to heading

optional
Jump to headingcallback: () => void

Optional callback for when the socket is finished.

Return Type Jump to heading

this

The socket itself.

Jump to headingSocket.prototype.end(
buffer: Uint8Array | string,
callback?: () => void,
): this

Parameters Jump to heading

Jump to headingbuffer: Uint8Array | string
optional
Jump to headingcallback: () => void

Return Type Jump to heading

this
Jump to headingSocket.prototype.end(
str: Uint8Array | string,
encoding?: BufferEncoding,
callback?: () => void,
): this

Parameters Jump to heading

Jump to headingstr: Uint8Array | string
optional
Jump to headingencoding: BufferEncoding
optional
Jump to headingcallback: () => void

Return Type Jump to heading

this
Back to top