cvmts: Actually unref ipdata on disconnect
This commit is contained in:
@@ -35,15 +35,21 @@ export class User {
|
|||||||
this.Config = config;
|
this.Config = config;
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
this.msgsSent = 0;
|
this.msgsSent = 0;
|
||||||
|
|
||||||
this.socket.on('disconnect', () => {
|
this.socket.on('disconnect', () => {
|
||||||
|
// Unref the ip data for this connection
|
||||||
|
this.IP.Unref();
|
||||||
|
|
||||||
clearInterval(this.nopSendInterval);
|
clearInterval(this.nopSendInterval);
|
||||||
clearInterval(this.msgRecieveInterval);
|
clearInterval(this.msgRecieveInterval);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.socket.on('msg', (e) => {
|
this.socket.on('msg', (e) => {
|
||||||
clearTimeout(this.nopRecieveTimeout);
|
clearTimeout(this.nopRecieveTimeout);
|
||||||
clearInterval(this.msgRecieveInterval);
|
clearInterval(this.msgRecieveInterval);
|
||||||
this.msgRecieveInterval = setInterval(() => this.onNoMsg(), 10000);
|
this.msgRecieveInterval = setInterval(() => this.onNoMsg(), 10000);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.nopSendInterval = setInterval(() => this.sendNop(), 5000);
|
this.nopSendInterval = setInterval(() => this.sendNop(), 5000);
|
||||||
this.msgRecieveInterval = setInterval(() => this.onNoMsg(), 10000);
|
this.msgRecieveInterval = setInterval(() => this.onNoMsg(), 10000);
|
||||||
this.sendNop();
|
this.sendNop();
|
||||||
|
|||||||
Reference in New Issue
Block a user