fix(core): update
This commit is contained in:
@@ -257,15 +257,25 @@ JNj2Dr5H0XoLFFnvuvzcRbhlJ9J67JzR+7g=
|
||||
|
||||
this.httpsServer.on('connection', (connection: plugins.net.Socket) => {
|
||||
connection.setTimeout(10000);
|
||||
let destroyed = false;
|
||||
this.socketMap.add(connection);
|
||||
console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`);
|
||||
const destroyConnection = () => {
|
||||
if (!destroyed) {
|
||||
destroyed = true;
|
||||
connection.destroy();
|
||||
console.log(`socket successfully destroyed.`);
|
||||
}
|
||||
}
|
||||
const cleanupConnection = () => {
|
||||
if (this.socketMap.checkForObject(connection)) {
|
||||
this.socketMap.remove(connection);
|
||||
plugins.smartdelay.delayFor(200).then(() => {
|
||||
destroyConnection();
|
||||
});
|
||||
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
|
||||
connection.end(() => {
|
||||
connection.destroy();
|
||||
console.log(`socket successfully destroyed`);
|
||||
destroyConnection();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user