Skip to content

Instantly share code, notes, and snippets.

@brapse
Created February 16, 2011 00:24
Show Gist options
  • Save brapse/828587 to your computer and use it in GitHub Desktop.
Save brapse/828587 to your computer and use it in GitHub Desktop.
var Stream = require('net').Stream;
var netBinding = process.binding('net');
var pair = netBinding.socketpair();
var a = new(Stream)({fd: pair[0], type: 'unix'});
var b = new(Stream)({fd: pair[1], type: 'unix'});
b.resume();
b.on('data', function () {
console.log(arguments);
});
a.end('foo');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment