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.
24 lines
500 B
24 lines
500 B
14 years ago
|
var common = require('../common');
|
||
|
var net = require('net');
|
||
|
var assert = require('assert');
|
||
|
|
||
|
var timedout = false;
|
||
|
|
||
|
var server = net.Server();
|
||
|
server.listen(common.PORT, function() {
|
||
|
var socket = net.createConnection(common.PORT);
|
||
|
socket.setTimeout(100, function() {
|
||
|
timedout = true;
|
||
|
socket.destroy();
|
||
|
server.close();
|
||
|
clearTimeout(timer);
|
||
|
});
|
||
|
var timer = setTimeout(function() {
|
||
|
process.exit(1);
|
||
|
}, 200);
|
||
|
});
|
||
|
|
||
|
process.on('exit', function() {
|
||
|
assert.ok(timedout);
|
||
|
});
|