0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/simple/test-net-eaddrinuse.js

15 lines
396 B
JavaScript
Raw Normal View History

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