Turns a duplex stream into an event emitter.
var s = net;var duplexEmitter = ;var emitter = ;
You can emit events. They will be serialized (to JSON) and piped to the stream.
emitter; // Send event to the other side
You can listen for events from the peer:
// Got event from the peeremitter