Permalink
Browse files

Create the client in the call instead of once globally.

  • Loading branch information...
1 parent 8210af9 commit d16da4e23bbd03fc713364604580db46119f30bd Eric Florenzano committed Nov 28, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/jsonrpc.js
View
@@ -10,9 +10,9 @@ var JSONRPCClient = function(port, host) {
this.port = port;
this.host = host;
- var client = http.createClient(port, host);
-
this.call = function(method, params, callback, errback, path) {
+ var client = http.createClient(port, host);
+
// First we encode the request into JSON
var requestJSON = JSON.stringify({
'id': '' + (new Date()).getTime(),
@@ -201,4 +201,4 @@ var JSONRPC = {
}
};
-process.mixin(exports, JSONRPC);
+process.mixin(exports, JSONRPC);

0 comments on commit d16da4e

Please sign in to comment.