ipc/server: differenciate 'close' and 'destroyed' events
This commit is contained in:
parent
27145901b4
commit
ef74db5ce2
3 changed files with 7 additions and 2 deletions
|
|
@ -29,6 +29,11 @@ module.exports = {
|
|||
close(data, clientId) {
|
||||
// client disconnected
|
||||
|
||||
},
|
||||
|
||||
destroyed(data, clientId) {
|
||||
// client removed (timeout)
|
||||
|
||||
// clear osc data cache
|
||||
if (widgetHashTable[clientId]) delete widgetHashTable[clientId]
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class Socket extends EventEmitter {
|
|||
|
||||
this.dieTimeout = setTimeout(()=>{
|
||||
|
||||
this.emit('close')
|
||||
this.emit('destroyed')
|
||||
|
||||
}, dieTimeout)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class Ipc extends EventEmitter {
|
|||
|
||||
this.emit('connection', client)
|
||||
|
||||
client.on('close', ()=>{
|
||||
client.on('destroyed', ()=>{
|
||||
delete this.clients[id]
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue