diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..770236b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +dist: trusty +sudo: false +node_js: + - "7.8" + diff --git a/README.MD b/README.MD index 0a8ecb7..661c995 100644 --- a/README.MD +++ b/README.MD @@ -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. diff --git a/src/Plugins/Client/WebSocketTransport.js b/src/Plugins/Client/WebSocketTransport.js index 8f59c64..f60cc59 100644 --- a/src/Plugins/Client/WebSocketTransport.js +++ b/src/Plugins/Client/WebSocketTransport.js @@ -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."); } }