Merge pull request #73 from Mostafa-Samir/disconnect/fix
Using a client-specific flag to disconnect instead of using config.stopRetrying
This commit is contained in:
commit
c2bffb5451
2 changed files with 6 additions and 3 deletions
|
@ -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');
|
||||
|
|
|
@ -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){
|
||||
|
|
Loading…
Reference in a new issue