protoo-client
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -138,2 +138,7 @@ 'use strict'; | ||
this._transport.on('disconnected', () => | ||
{ | ||
this.emit('disconnected'); | ||
}); | ||
this._transport.on('close', () => | ||
@@ -140,0 +145,0 @@ { |
@@ -92,2 +92,3 @@ 'use strict'; | ||
let operation = retry.operation(this._options.retry || DEFAULT_RETRY_OPTIONS); | ||
let wasConnected = false; | ||
@@ -118,2 +119,4 @@ operation.attempt((currentAttempt) => | ||
wasConnected = true; | ||
// Emit 'open' event. | ||
@@ -128,3 +131,3 @@ this.emit('open'); | ||
logger.error('WebSocket "close" event [wasClean:%s, code:%s, reason:"%s"]', | ||
logger.warn('WebSocket "close" event [wasClean:%s, code:%s, reason:"%s"]', | ||
event.wasClean, event.code, event.reason); | ||
@@ -135,4 +138,18 @@ | ||
{ | ||
if (operation.retry(true)) | ||
// If is was not connected, try agein. | ||
if (!wasConnected) | ||
{ | ||
if (operation.retry(true)) | ||
return; | ||
} | ||
// If is was connected, start from scratch. | ||
else | ||
{ | ||
operation.stop(); | ||
this.emit('disconnected'); | ||
this._setWebSocket(); | ||
return; | ||
} | ||
} | ||
@@ -139,0 +156,0 @@ |
{ | ||
"name": "protoo-client", | ||
"version": "1.1.3", | ||
"version": "1.1.4", | ||
"description": "protoo JavaScript client library", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13478
555