diff --git a/lib/client.js b/lib/client.js index 680920e..e16601f 100644 --- a/lib/client.js +++ b/lib/client.js @@ -102,6 +102,8 @@ function connect(){ 'error', function(err){ client.log('\n\n######\nerror: '.error, err); + client.trigger('error', err); + } ); @@ -110,7 +112,7 @@ function connect(){ function(){ client.trigger('connect'); client.retriesRemaining=client.config.maxRetries; - client.log('retrying reset') + client.log('retrying reset'); } ); @@ -123,6 +125,7 @@ function connect(){ client.config.stopRetrying || client.retriesRemaining<1 ){ + client.trigger('disconnect'); client.log( client.config.id.variable, 'exceeded connection rety amount of'.warn, @@ -130,6 +133,7 @@ function connect(){ ); client.socket.destroy(); + client.trigger('destroy'); client=undefined; return;