added socket flags
This commit is contained in:
parent
1447a21c8c
commit
acdcd1330f
@ -233,6 +233,7 @@ Node.prototype.setupSockets = function()
|
||||
})
|
||||
.on('timeout', function ()
|
||||
{
|
||||
self._socket = false;
|
||||
console.error('wsc', 'Socket connection timeout');
|
||||
})
|
||||
.on('close', function ()
|
||||
@ -247,6 +248,7 @@ Node.prototype.setupSockets = function()
|
||||
})
|
||||
.on('online', function ()
|
||||
{
|
||||
self._socket = true;
|
||||
console.info('wsc', 'Network connection is online');
|
||||
})
|
||||
.on('reconnect', function ()
|
||||
@ -255,19 +257,23 @@ Node.prototype.setupSockets = function()
|
||||
})
|
||||
.on('reconnect scheduled', function (opts)
|
||||
{
|
||||
self._socket = false;
|
||||
console.warn('wsc', 'Reconnecting in', opts.scheduled, 'ms');
|
||||
console.warn('wsc', 'This is attempt', opts.attempt, 'out of', opts.retries);
|
||||
})
|
||||
.on('reconnected', function (opts)
|
||||
{
|
||||
self._socket = true;
|
||||
console.success('wsc', 'Socket reconnected successfully after', opts.duration, 'ms');
|
||||
})
|
||||
.on('reconnect timeout', function (err, opts)
|
||||
{
|
||||
self._socket = false;
|
||||
console.error('wsc', 'Socket reconnect atempt took too long:', err.message);
|
||||
})
|
||||
.on('reconnect failed', function (err, opts)
|
||||
{
|
||||
self._socket = false;
|
||||
console.error('wsc', 'Socket reconnect failed:', err.message);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user