@gobark/udprpc
Advanced tools
Comparing version 0.1.2 to 0.1.3
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const UdpSocket_1 = require("./UdpSocket"); | ||
const Config_1 = require("./Config"); | ||
const _REQUEST = "request"; | ||
@@ -17,9 +16,12 @@ const _RESPONSE = "response"; | ||
constructor(port, udpSocketClass) { | ||
this._udpRpcRetriesTimeout = Number(process.env.udpRpcRetriesTimeout || Config_1.Config.udpRpcRetriesTimeout); | ||
this._udpRpcTimeout = Number(process.env.udpRpcTimeout || Config_1.Config.udpRpcTimeout); | ||
this._udpRpcRetriesTimeout = 150; | ||
this._udpRpcTimeout = 40; | ||
if (process.env.udpRpcRetriesTimeout) { | ||
this._udpRpcRetriesTimeout = Number(process.env.udpRpcRetriesTimeout); | ||
} | ||
if (process.env.udpRpcTimeout) { | ||
this._udpRpcTimeout = Number(process.env.udpRpcTimeout); | ||
} | ||
this._port = port; | ||
if (!udpSocketClass) { | ||
udpSocketClass = Config_1.Config.udpSocketClass; | ||
} | ||
if (!udpSocketClass) { | ||
udpSocketClass = UdpSocket_1.UdpSocketNative; | ||
@@ -26,0 +28,0 @@ } |
@@ -8,3 +8,2 @@ "use strict"; | ||
const UdpSocketRouterSimulator_1 = require("./UdpSocketRouterSimulator"); | ||
const Config_1 = require("../code/Config"); | ||
describe("Udp Socket Router Simulator Test:", () => { | ||
@@ -31,7 +30,5 @@ before(() => { | ||
it("testing dependency injection map", () => { | ||
Config_1.Config.udpSocketClass = UdpSocketRouterSimulator_1.UdpSocketRouterSimulator; | ||
let dummyClazz = Config_1.Config.udpSocketClass; | ||
let dummyClazz = UdpSocketRouterSimulator_1.UdpSocketRouterSimulator; | ||
let aDummy = new dummyClazz(); | ||
assert(aDummy instanceof UdpSocketRouterSimulator_1.UdpSocketRouterSimulator); | ||
Config_1.Config.udpSocketClass = null; | ||
}); | ||
@@ -38,0 +35,0 @@ after(() => { |
{ | ||
"name": "@gobark/udprpc", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "A UDP-based JSON-RPC 2.0 library for peer-to-peer communications with support for ES6 promises", | ||
@@ -5,0 +5,0 @@ "main": "dist/code/UdpRpc.js", |
@@ -74,2 +74,3 @@ [![Build Status](https://travis-ci.org/perspectivus1/udprpc.svg?branch=master)](https://travis-ci.org/perspectivus1/udprpc) | ||
* Implement secure UDP communications ([DTLS](https://en.wikipedia.org/wiki/Datagram_Transport_Layer_Security)) | ||
* Support IPv6 | ||
### Modifying this package ### | ||
@@ -76,0 +77,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
82
35233
27
464
4