server.close([callback])


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

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

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

该函数异步操作。当服务器没有更多打开的连接时,将触发 'close' 事件。

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