diff --git a/.run/main.js.run.xml b/.run/main.js.run.xml new file mode 100644 index 0000000..71c8e4f --- /dev/null +++ b/.run/main.js.run.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/main.js b/main.js index 7da93e8..ff041a6 100644 --- a/main.js +++ b/main.js @@ -1505,6 +1505,7 @@ class WSServer { onClientSessionPdu(sessionId, pdu) { // TODO: Maybe move this to an "ignored" array against who the pdu.command is compared + // TODO: Figure out why the same client is getting the same pdu more than once if (pdu.command === 'enquire_link_resp' || pdu.command === 'enquire_link') { return; } @@ -1518,6 +1519,7 @@ class WSServer { value: pdu } this.logger.log2(`Broadcasting session with ID ${sessionId} to ${clients.length} clients`); + console.log(clients); clients.forEach(client => { client.send(JSON.stringify(payload)); }); @@ -1672,8 +1674,7 @@ function cleanup() { process.exit(0); } -// process.on('exit', cleanup); -// process.on('SIGINT', cleanup); -// process.on('SIGUSR1', cleanup); -// process.on('SIGUSR2', cleanup); -// process.on('uncaughtException', cleanup); \ No newline at end of file +process.on('exit', cleanup); +process.on('SIGINT', cleanup); +process.on('SIGUSR1', cleanup); +process.on('SIGUSR2', cleanup); \ No newline at end of file diff --git a/websocketTest.js b/websocketTest.js index 72aa2ff..a7f7a63 100644 --- a/websocketTest.js +++ b/websocketTest.js @@ -6,7 +6,7 @@ const ws = new WebSocket(`ws://localhost:${WS_SERVER_PORT}`); const ws2 = new WebSocket(`ws://localhost:${WS_SERVER_PORT}`); ws.on('open', () => { console.log('WebSocket connection established'); - ws.send("client:0"); + ws.send("client:1"); }); ws.on('message', (data) => { console.log(String(data));