Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
dist: trusty
sudo: false
node_js:
- "7.8"

2 changes: 2 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Bidirectional JSON-RPC 2.0 server and client

[![Build Status](https://travis-ci.org/oxygens/jsonrpc-bidirectional.svg?branch=master)](https://travis-ci.org/oxygens/jsonrpc-bidirectional)

A main goal of this project is to have the JSONRPC server and client support __bidirectional JSON-RPC requests over a single WebSocket connection.__

Both the server and client support two __transports, HTTP and WebSocket__ ([websockets/ws](https://github.com/websockets/ws) compatible API), and allow more through plugin extensibility.
Expand Down
9 changes: 9 additions & 0 deletions src/Plugins/Client/WebSocketTransport.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,19 @@ class WebSocketTransport extends JSONRPC.ClientPluginBase
//console.error(error);
console.log("[" + process.pid + "] Rejecting all Promise instances in WebSockets/JSONRPCClientPlugin.");

let nCount = 0;

for(let nCallID in this._objWebSocketRequestsPromises)
{
this._objWebSocketRequestsPromises[nCallID].fnReject(error);
delete this._objWebSocketRequestsPromises[nCallID];

nCount++;
}

if(nCount)
{
console.error("[" + process.pid + "] Rejected " + nCount + " Promise instances in WebSockets/JSONRPCClientPlugin.");
}
}

Expand Down