Welcome to mirror list, hosted at ThFree Co, Russian Federation.

echo-close-check.js « fixtures « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c71b63ec901ae8a0110bfd83abb8b36173a8cad3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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();
  });
});