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
528 B
21 lines
528 B
11 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
|
var net = require('net');
|
||
|
|
||
|
process.stdout.write('hello world\r\n');
|
||
|
|
||
|
var stdin = process.openStdin();
|
||
|
|
||
|
stdin.on('data', function(data) {
|
||
|
process.stdout.write(data.toString());
|
||
|
});
|
||
|
|
||
|
stdin.on('end', function() {
|
||
|
// If stdin's fd will be closed - createServer may get it
|
||
|
var server = net.createServer(function() {
|
||
|
}).listen(common.PORT, function() {
|
||
|
assert(typeof server._handle.fd !== 'number' || server._handle.fd > 2);
|
||
|
server.close();
|
||
|
});
|
||
|
});
|