1'use strict'; 2 3const common = require('../common'); 4const { spawn } = require('child_process'); 5const net = require('net'); 6 7const tmpdir = require('../common/tmpdir'); 8tmpdir.refresh(); 9 10const server = net.createServer((conn) => { 11 spawn(process.execPath, ['-v'], { 12 stdio: ['ignore', conn, 'ignore'] 13 }).on('close', common.mustCall(() => { 14 conn.end(); 15 })); 16}).listen(common.PIPE, () => { 17 const client = net.connect(common.PIPE, common.mustCall()); 18 client.on('data', () => { 19 client.end(() => { 20 server.close(); 21 }); 22 }); 23}); 24