diff --git a/dao/client.js b/dao/client.js index e56e689..ef54a57 100644 --- a/dao/client.js +++ b/dao/client.js @@ -16,7 +16,8 @@ function init(config,log){ connect : connect, emit : emit, log : log, - retriesRemaining:config.maxRetries||0 + retriesRemaining:config.maxRetries||0, + explicitlyDisconnected: false }; new Pubsub(client); @@ -143,7 +144,9 @@ function connect(){ ); if( - client.config.stopRetrying || client.retriesRemaining<1 + client.config.stopRetrying || + client.retriesRemaining<1 || + client.explicitlyDisconnected ){ client.trigger('disconnect'); diff --git a/services/IPC.js b/services/IPC.js index 91f9aed..083866d 100644 --- a/services/IPC.js +++ b/services/IPC.js @@ -92,7 +92,7 @@ function disconnect(id){ return; } - this.of[id].config.stopRetrying=true; + this.of[id].explicitlyDisconnected=true; this.of[id].off('*'); if(this.of[id].socket){