removed seemingly unnecessary resetRetriesCheck function

the function being set to fire after 100ms conflicted with delays in firing the 'disconnect' event on windows, and this resulted in the socket's 'retriesRemianing' being reset after every decrement and thus violatin the 'maxRetries' rule
This commit is contained in:
Mostafa Samir 2016-04-01 20:26:26 +02:00
parent b60152d0b3
commit d3181ddafe

View file

@ -160,21 +160,10 @@ function connect(){
return; return;
} }
client.isRetrying=true;
setTimeout( setTimeout(
function retryTimeout(){ function retryTimeout(){
client.retriesRemaining--; client.retriesRemaining--;
client.isRetrying=false;
client.connect(); client.connect();
setTimeout(
function resetRetriesCheck(){
if(!client.isRetrying){
client.retriesRemaining=client.config.maxRetries;
}
},
100
);
}.bind(null,client), }.bind(null,client),
client.config.retry client.config.retry
); );