server.close([callback])


  • callback <Function> 监听器回调,将被注册以监听服务器实例的 'close' 事件。
  • 返回: <tls.Server>

server.close() 方法阻止服务器接受新连接。

此函数异步地运行。 当服务器没有更多打开的连接时,则将触发 'close' 事件。

  • callback <Function> A listener callback that will be registered to listen for the server instance's 'close' event.
  • Returns: <tls.Server>

The server.close() method stops the server from accepting new connections.

This function operates asynchronously. The 'close' event will be emitted when the server has no more open connections.