method Socket.prototype.closeSocket.prototype.close(callback?: () => void): thisDeprecatedClose 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. Parametersoptionalcallback: () => voidCalled when the socket has been closed. Return Typethis