/** * Function to send info to all sockets * * @param instruction * @param data */ informAllSockets(instruction, data) { if(this.socket === null) { return; } this.socket.getWss().clients.forEach(client => { // Check if connection is still open if (client.readyState !== client.OPEN) return; client.send(this.encrypt({ instruction, data })); }); }
reject(new Error(timeoutStack)) }) wss.getWss().close(() => { clearTimeout(timeoutId) resolve()