()
| 63 | } |
| 64 | |
| 65 | startServer() { |
| 66 | this.wss = new WebSocket.Server({ |
| 67 | port: this.port, |
| 68 | clientTracking: true, |
| 69 | path: '/watch', |
| 70 | }); |
| 71 | |
| 72 | this.wss.on('connection', this.onConnection.bind(this)); |
| 73 | this.wss.on('listening', this.onListening.bind(this)); |
| 74 | this.wss.on('error', this.onError.bind(this)); |
| 75 | |
| 76 | setInterval(this.checkBrokenConnections.bind(this), |
| 77 | CHECK_BROKEN_CONNECTIONS_FREQUENCY_MS); |
| 78 | |
| 79 | addOverlayMessageListener(this.onNewOverlay.bind(this)); |
| 80 | } |
| 81 | |
| 82 | onConnection(socket, request) { |
| 83 | function hearthbeat() { |
no test coverage detected