(connectionId: string)
| 191 | } |
| 192 | |
| 193 | public closeConnection(connectionId: string): boolean { |
| 194 | const connection = this.connections.get(connectionId); |
| 195 | if (!connection) { |
| 196 | return false; |
| 197 | } |
| 198 | |
| 199 | connection.clientSocket.destroy(); |
| 200 | connection.serverSocket.destroy(); |
| 201 | this.connections.delete(connectionId); |
| 202 | this.emit('disconnect', connection); |
| 203 | return true; |
| 204 | } |
| 205 | |
| 206 | public sendToClient(connectionId: string, data: Buffer): SendResult { |
| 207 | const connection = this.connections.get(connectionId); |