commit 1d9581632fe3a99c2068d8c0cece9345c9397cc8
parent e71564a97cc083b606f144db4de3e35e5e172bfb
Author: RobinLinus <robinlinus@users.noreply.github.com>
Date: Fri, 21 Sep 2018 20:25:54 +0200
Cancel keep alive on join room
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/server/index.js b/server/index.js
@@ -11,7 +11,6 @@ class SnapdropServer {
this._wss.on('headers', (headers, response) => this._onHeaders(headers, response));
this._rooms = {};
- this._timerID = 0;
console.log('Snapdrop is running on port', port);
}
@@ -119,6 +118,7 @@ class SnapdropServer {
}
_keepAlive(peer) {
+ this._cancelKeepAlive(peer);
var timeout = 10000;
if (!peer.lastBeat) {
peer.lastBeat = Date.now();
@@ -130,7 +130,6 @@ class SnapdropServer {
this._send(peer, { type: 'ping' });
- this._cancelKeepAlive(peer);
peer.timerId = setTimeout(() => this._keepAlive(peer), timeout);
}