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

listen-on-socket-and-exit.js « fixtures « test - github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8627625965e87df3f7e1e9ec28d86679d7556c48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// child process that listens on a socket, allows testing of an EADDRINUSE condition

const common = require('../common');
const net = require('net');

common.refreshTmpDir();

var server = net.createServer().listen(common.PIPE, function() {
  console.log('child listening');
  process.send('listening');
});

function onmessage() {
  console.log('child exiting');
  server.close();
}

process.once('message', onmessage);