@serverless/platform-client
Advanced tools
Comparing version 3.6.0 to 3.6.1
{ | ||
"name": "@serverless/platform-client", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"main": "./src/index.js", | ||
@@ -5,0 +5,0 @@ "jsdelivr": "dist-web/serverless-platform-client.min.js", |
@@ -105,15 +105,18 @@ 'use strict'; | ||
// a `pong` within 500 ms. | ||
this.pingInterval = setInterval(() => { | ||
this.pingTimeout = setTimeout(() => { | ||
// Use `WebSocket#terminate()`, which immediately destroys the connection, | ||
// instead of `WebSocket#close()`, which waits for the close timer. | ||
this.connection.terminate(); | ||
this.connection = null; | ||
}, 500); | ||
this.connection.ping(); | ||
}, 1000); | ||
if (this.connection.ping) { | ||
// NOT available in browser | ||
this.pingInterval = setInterval(() => { | ||
this.pingTimeout = setTimeout(() => { | ||
// Use `WebSocket#terminate()`, which immediately destroys the connection, | ||
// instead of `WebSocket#close()`, which waits for the close timer. | ||
this.connection.terminate(); | ||
this.connection = null; | ||
}, 500); | ||
this.connection.ping(); | ||
}, 1000); | ||
this.connection.on('pong', () => { | ||
clearTimeout(this.pingTimeout); | ||
}); | ||
this.connection.on('pong', () => { | ||
clearTimeout(this.pingTimeout); | ||
}); | ||
} | ||
@@ -120,0 +123,0 @@ return resolve(); |
Sorry, the diff of this file is too big to display
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
1266551
7330