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.
23 lines
589 B
23 lines
589 B
'use strict';
|
|
const common = require('../common');
|
|
const net = require('net');
|
|
|
|
const server = net.createServer(common.mustCall(function(socket) {
|
|
socket.resume();
|
|
|
|
socket.on('error', common.mustCall(function(error) {
|
|
console.error('got error, closing server', error);
|
|
server.close();
|
|
}));
|
|
|
|
setTimeout(common.mustCall(function() {
|
|
console.error('about to try to write');
|
|
socket.write('test', common.mustCall(function(e) {}));
|
|
}), 250);
|
|
}));
|
|
|
|
server.listen(0, function() {
|
|
const client = net.connect(this.address().port, function() {
|
|
client.end();
|
|
});
|
|
});
|
|
|