Skip to content
This repository
Browse code

expose the stream object in .connect()

  • Loading branch information...
commit c8239bc4c0f1b28aa0bd2c260f094301e5b4363f 1 parent 9ed1c70
James Halliday authored

Showing 2 changed files with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. 5  index.js
  2. 2  package.json
5  index.js
@@ -14,6 +14,7 @@ function dnode (wrapper) {
14 14
     
15 15
     this.proto = protocol(wrapper);
16 16
     this.stack = [];
  17
+    this.streams = [];
17 18
     return this;
18 19
 }
19 20
 
@@ -52,7 +53,7 @@ dnode.prototype.connect = function () {
52 53
         });
53 54
     }
54 55
     else {
55  
-      attachDnode();
  56
+        attachDnode();
56 57
     } 
57 58
     
58 59
     stream.remoteAddress = params.host;
@@ -93,7 +94,6 @@ dnode.prototype.connect = function () {
93 94
     }
94 95
     
95 96
     function attachDnode() {
96  
-      
97 97
         client = createClient(self.proto, stream);
98 98
         
99 99
         client.end = function () {
@@ -123,6 +123,7 @@ dnode.prototype.connect = function () {
123 123
         client.start();
124 124
     };
125 125
     
  126
+    this.streams.push(stream);
126 127
     return this;
127 128
 };
128 129
 
2  package.json
... ...
@@ -1,6 +1,6 @@
1 1
 {
2 2
     "name" : "dnode",
3  
-    "version" : "0.9.2",
  3
+    "version" : "0.9.3",
4 4
     "description" : "freestyle RPC",
5 5
     "main" : "./index.js",
6 6
     "keywords" : [

0 notes on commit c8239bc

Please sign in to comment.
Something went wrong with that request. Please try again.