fix(core): update
This commit is contained in:
parent
078730153d
commit
f885e49e34
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedserver',
|
||||
version: '2.0.60',
|
||||
version: '2.0.61',
|
||||
description: 'easy serving of static files'
|
||||
}
|
||||
|
@ -218,25 +218,24 @@ export class Server {
|
||||
this.httpServer.on('connection', (connection: plugins.net.Socket) => {
|
||||
this.socketMap.add(connection);
|
||||
console.log(`added connection. now ${this.socketMap.getArray().length} sockets connected.`);
|
||||
const cleanListener = () => {
|
||||
cleanupConnection();
|
||||
}
|
||||
const cleanupConnection = () => {
|
||||
connection.removeListener('close', cleanListener);
|
||||
connection.removeListener('error', cleanListener);
|
||||
connection.removeListener('end', cleanListener);
|
||||
connection.removeListener('timeout', cleanListener);
|
||||
if (this.socketMap.checkForObject(connection)) {
|
||||
this.socketMap.remove(connection);
|
||||
console.log(`removed connection. ${this.socketMap.getArray().length} sockets remaining.`);
|
||||
connection.destroy();
|
||||
}
|
||||
};
|
||||
connection.on('close', () => {
|
||||
cleanupConnection();
|
||||
});
|
||||
connection.on('error', () => {
|
||||
cleanupConnection();
|
||||
});
|
||||
connection.on('end', () => {
|
||||
cleanupConnection();
|
||||
});
|
||||
connection.on('timeout', () => {
|
||||
cleanupConnection();
|
||||
});
|
||||
connection.addListener('close', cleanListener);
|
||||
connection.addListener('error', cleanListener);
|
||||
connection.addListener('end', cleanListener);
|
||||
connection.addListener('timeout', cleanListener);
|
||||
});
|
||||
|
||||
// finally listen on a port
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@apiglobal/typedserver',
|
||||
version: '2.0.60',
|
||||
version: '2.0.61',
|
||||
description: 'easy serving of static files'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user