mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
Cancel keep alive on join room
This commit is contained in:
parent
b0fd89eb96
commit
61697d3abc
1 changed files with 4 additions and 1 deletions
|
@ -53,11 +53,13 @@ class SnapdropServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
_joinRoom(peer) {
|
_joinRoom(peer) {
|
||||||
this._cancelKeepAlive(peer);
|
|
||||||
// if room doesn't exist, create it
|
// if room doesn't exist, create it
|
||||||
if (!this._rooms[peer.ip]) {
|
if (!this._rooms[peer.ip]) {
|
||||||
this._rooms[peer.ip] = {};
|
this._rooms[peer.ip] = {};
|
||||||
}
|
}
|
||||||
|
if (this._rooms[peer.ip][peer.id]) {
|
||||||
|
this._cancelKeepAlive(this._rooms[peer.ip][peer.id]);
|
||||||
|
}
|
||||||
|
|
||||||
// console.log(peer.id, ' joined the room', peer.ip);
|
// console.log(peer.id, ' joined the room', peer.ip);
|
||||||
// notify all other peers
|
// notify all other peers
|
||||||
|
@ -128,6 +130,7 @@ class SnapdropServer {
|
||||||
type: 'ping'
|
type: 'ping'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
this._cancelKeepAlive(peer);
|
||||||
peer.timerId = setTimeout(() => this._keepAlive(peer), timeout);
|
peer.timerId = setTimeout(() => this._keepAlive(peer), timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue