2010-12-05 07:20:34 +08:00
|
|
|
var common = require('../common');
|
|
|
|
var assert = require('assert');
|
|
|
|
var net = require('net');
|
2010-10-07 01:18:08 +08:00
|
|
|
|
|
|
|
var server1 = net.createServer(function (socket) {
|
|
|
|
});
|
|
|
|
var server2 = net.createServer(function (socket) {
|
|
|
|
});
|
2010-10-24 02:22:24 +08:00
|
|
|
server1.listen(common.PORT);
|
2010-10-07 01:18:08 +08:00
|
|
|
server2.addListener('error', function(error) {
|
|
|
|
assert.equal(true, error.message.indexOf('EADDRINUSE') >= 0);
|
|
|
|
server1.close();
|
|
|
|
});
|
2010-10-24 02:22:24 +08:00
|
|
|
server2.listen(common.PORT);
|