()
| 161 | } |
| 162 | |
| 163 | checkBrokenConnections() { |
| 164 | this.wss.clients.forEach(client => { |
| 165 | if (!client.isAlive) { |
| 166 | logger.info('close broken connection', { |
| 167 | client: client._socket._peername, |
| 168 | }); |
| 169 | client.terminate(); |
| 170 | return; |
| 171 | } |
| 172 | client.isAlive = false; |
| 173 | client.ping(); |
| 174 | }); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | const server = new ManagementAgentServer(); |