* 停止服务器
()
| 89 | * 停止服务器 |
| 90 | */ |
| 91 | async stop(): Promise<void> { |
| 92 | if (this.wsServer) { |
| 93 | this.wsServer.close(); |
| 94 | } |
| 95 | if (this.server) { |
| 96 | this.server.close(); |
| 97 | } |
| 98 | this.clients.clear(); |
| 99 | this.emit('stopped'); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * 处理 WebSocket 连接 |
no test coverage detected