Skip to content

Instantly share code, notes, and snippets.

@geNAZt
Created January 24, 2013 15:28
Show Gist options
  • Save geNAZt/4623074 to your computer and use it in GitHub Desktop.
Save geNAZt/4623074 to your computer and use it in GitHub Desktop.
var util = require('util');
var Stream = require('stream');
var stream1 = new Stream();
stream1.readable = stream1.writable = true;
stream1.paused = false;
console.log(util.inspect(stream1, null, true));
var stream2 = new Stream();
stream2.readable = stream2.writable = true;
stream2.paused = false;
//stream1.pipe(stream2).pipe(stream1);
stream2.on('data', console.log.bind(console));
stream1.write("jdklsaj");
@geNAZt
Copy link
Author

geNAZt commented Jan 24, 2013

Result:

{ domain: null,
_events: null,
_maxListeners: 10,
writable: true,
readable: true,
paused: false }

F:\Projekte\tcp-stream-muxer\test\simple\stream-pipe.js:17
stream1.write("jdklsaj");
^
TypeError: Object # has no method 'write'
at Object. (F:\Projekte\tcp-stream-muxer\test\simple\stream-pipe.js:17:9)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment