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
585 B
23 lines
585 B
'use strict';
|
|
const common = require('../common');
|
|
const net = require('net');
|
|
|
|
var 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() {
|
|
var client = net.connect(this.address().port, function() {
|
|
client.end();
|
|
});
|
|
});
|
|
|