@push-rpc/core
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -30,2 +30,3 @@ import { RpcSession } from "./RpcSession"; | ||
delayCalls: number; | ||
connectionTimeout: number; | ||
} | ||
@@ -32,0 +33,0 @@ export declare class RpcClient<R> { |
@@ -76,2 +76,3 @@ "use strict"; | ||
delayCalls: 0, | ||
connectionTimeout: 10 * 1000, | ||
}; | ||
@@ -121,9 +122,10 @@ var RpcClient = /** @class */ (function () { | ||
connected_1 = false; | ||
timer = setTimeout(function () { | ||
if (!connected_1) | ||
reject(new Error("Connection timeout")); | ||
}, 10 * 1000) // 10s connection timeout | ||
; | ||
if (timer.unref) { | ||
timer.unref(); | ||
if (this.opts.connectionTimeout) { | ||
timer = setTimeout(function () { | ||
if (!connected_1) | ||
reject(new Error("Connection timeout")); | ||
}, this.opts.connectionTimeout); | ||
if (timer.unref) { | ||
timer.unref(); | ||
} | ||
} | ||
@@ -130,0 +132,0 @@ socket_1.onOpen(function () { |
{ | ||
"name": "@push-rpc/core", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"main": "dist/index.js", | ||
@@ -21,3 +21,3 @@ "types": "dist/index.d.ts", | ||
}, | ||
"gitHead": "c0d75bc93b480a01668e03dc0d1d5909d06999ca" | ||
"gitHead": "b9fbe8dfcc2461679e7cfb0ee0268a1082777f50" | ||
} |
@@ -32,2 +32,3 @@ import {RpcSession} from "./RpcSession" | ||
delayCalls: number | ||
connectionTimeout: number | ||
} | ||
@@ -58,2 +59,3 @@ | ||
delayCalls: 0, | ||
connectionTimeout: 10 * 1000, | ||
} | ||
@@ -91,8 +93,10 @@ | ||
const timer = setTimeout(() => { | ||
if (!connected) reject(new Error("Connection timeout")) | ||
}, 10 * 1000) // 10s connection timeout | ||
if (this.opts.connectionTimeout) { | ||
const timer = setTimeout(() => { | ||
if (!connected) reject(new Error("Connection timeout")) | ||
}, this.opts.connectionTimeout) | ||
if (timer.unref) { | ||
timer.unref() | ||
if (timer.unref) { | ||
timer.unref() | ||
} | ||
} | ||
@@ -99,0 +103,0 @@ |
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
181120
4771