socket.close([callback])


  • callback <Function> 当套接字关闭时调用。

关闭底层套接字并停止监听其上的数据。 如果提供回调,则将其添加为 'close' 事件的监听器。

  • callback <Function> Called when the socket has been closed.

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.