diff --git a/src/cs/index.ts b/src/cs/index.ts index 2744729..9aad8c9 100644 --- a/src/cs/index.ts +++ b/src/cs/index.ts @@ -148,7 +148,12 @@ export default class CentralSystem { this.listeners.push(listener); } - public close(): Promise { + public async close(): Promise { + Object.values(this.connections).map((chargepointConnections) => { + chargepointConnections.map((connection) => { + connection.close(); + }); + }) const httpClosing = new Promise(resolve => this.httpServer.close(resolve)); const wsClosing = new Promise(resolve => this.websocketsServer.close(resolve)); return Promise.all([httpClosing, wsClosing]).then(() => { }); @@ -358,4 +363,4 @@ export default class CentralSystem { this.listeners.forEach((f) => f(chargePointId, 'disconnected')); }); } -} +} \ No newline at end of file