Skip to main content

close

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

Close the underlying socket and stop listening for data on it. If a callback is provided, it is added as a listener for the 'close' event.

Parameters Jump to heading

optional
Jump to headingcallback: () => void

Called when the socket has been closed.

Return Type Jump to heading

this
Back to top