@push-rpc/core
Advanced tools
Comparing version 1.0.29 to 1.0.30
@@ -110,6 +110,11 @@ "use strict"; | ||
resubscribeTopics(this.remote); | ||
socket.onPing(function () { | ||
_this.listeners.messageIn("PING"); | ||
}); | ||
if (this.pingSendTimeout) { | ||
this.pingTimer = setTimeout(this.sendPing, this.pingSendTimeout); | ||
socket.onPong(function () { | ||
_this.listeners.messageIn("PONG"); | ||
} | ||
socket.onPong(function () { | ||
_this.listeners.messageIn("PONG"); | ||
if (_this.pingSendTimeout) { | ||
if (_this.runningCalls[PING_MESSAGE_ID]) { | ||
@@ -120,4 +125,4 @@ _this.runningCalls[PING_MESSAGE_ID].resolve(); | ||
_this.sendCall(); | ||
}); | ||
} | ||
} | ||
}); | ||
this.callTimeoutTimer = setInterval(function () { return _this.timeoutCalls(); }, 1000); // every 1s | ||
@@ -124,0 +129,0 @@ }; |
@@ -7,2 +7,3 @@ export interface Socket { | ||
onPong(h: () => void): any; | ||
onPing(h: () => void): any; | ||
terminate(): any; | ||
@@ -9,0 +10,0 @@ send(data: string): any; |
{ | ||
"name": "@push-rpc/core", | ||
"version": "1.0.29", | ||
"version": "1.0.30", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -50,8 +50,14 @@ import {log} from "./logger" | ||
socket.onPing(() => { | ||
this.listeners.messageIn("PING") | ||
}) | ||
if (this.pingSendTimeout) { | ||
this.pingTimer = setTimeout(this.sendPing, this.pingSendTimeout) | ||
} | ||
socket.onPong(() => { | ||
this.listeners.messageIn("PONG") | ||
socket.onPong(() => { | ||
this.listeners.messageIn("PONG") | ||
if (this.pingSendTimeout) { | ||
if (this.runningCalls[PING_MESSAGE_ID]) { | ||
@@ -63,4 +69,4 @@ this.runningCalls[PING_MESSAGE_ID].resolve() | ||
this.sendCall() | ||
}) | ||
} | ||
} | ||
}) | ||
@@ -67,0 +73,0 @@ this.callTimeoutTimer = setInterval(() => this.timeoutCalls(), 1000) // every 1s |
@@ -1,3 +0,1 @@ | ||
import {RpcSession} from "./RpcSession" | ||
export interface Socket { | ||
@@ -9,2 +7,3 @@ onMessage(h: (message: string) => void) | ||
onPong(h: () => void) | ||
onPing(h: () => void) | ||
@@ -11,0 +10,0 @@ terminate() |
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
117356
3130