socket.close([callback])


  • callback <Function> 当 socket 已被关闭时调用。

关闭该 socket 并停止监听其上的数据。 如果提供了一个回调函数,它就相当于为 '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.