mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
495 B
21 lines
495 B
12 years ago
|
var common = require('../common.js');
|
||
|
var stream = require('stream');
|
||
|
var Buffer = require('buffer').Buffer;
|
||
|
|
||
12 years ago
|
var r = new stream.Readable();
|
||
|
r._read = function(size) {
|
||
|
r.push(new Buffer(size));
|
||
12 years ago
|
};
|
||
|
|
||
12 years ago
|
var w = new stream.Writable();
|
||
12 years ago
|
w._write = function(data, encoding, cb) {
|
||
12 years ago
|
cb(null);
|
||
|
};
|
||
|
|
||
12 years ago
|
r.pipe(w);
|
||
12 years ago
|
|
||
|
// This might sound unrealistic, but it happens in net.js. When
|
||
|
// `socket.allowHalfOpen === false`, EOF will cause `.destroySoon()` call which
|
||
|
// ends the writable side of net.Socket.
|
||
12 years ago
|
w.end();
|