Permalink
Browse files

expose conn.stream to preserve the api and expose things like remoteA…

…ddress
  • Loading branch information...
1 parent 26f8a1c commit 92391649d228171c032f0993214004c815f3c66b @substack committed Jul 28, 2012
Showing with 4 additions and 1 deletion.
  1. +3 −0 index.js
  2. +1 −1 package.json
View
3 index.js
@@ -18,6 +18,7 @@ var upnode = module.exports = function (cons) {
var server = net.createServer(function (stream) {
var d = dnode(cons);
+ d.stream = stream;
d.pipe(stream).pipe(d);
d.on('local', function (local) {
@@ -225,6 +226,7 @@ function connect (up, cons) {
var isUp = Boolean(up.conn);
up.conn = null;
up.remote = null;
+ up.stream = null;
stream.destroy();
if (alive && !up.closed) setTimeout(reconnect, opts.reconnect);
@@ -240,6 +242,7 @@ function connect (up, cons) {
cb.call(this, remote, client);
});
var stream = net.connect(opts.port, opts.host);
+ client.stream = stream;
stream.pipe(client).pipe(stream);
stream.on('error', onend);
View
2 package.json
@@ -1,7 +1,7 @@
{
"name" : "upnode",
"description" : "transactional connection queue for dnode",
- "version" : "0.3.0",
+ "version" : "0.3.1",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/upnode.git"

0 comments on commit 9239164

Please sign in to comment.