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
2010-10-23 11:22:24 -07:00

15 lines
379 B
JavaScript

common = require('../common');
assert = common.assert
net = require('net');
var server1 = net.createServer(function (socket) {
});
var server2 = net.createServer(function (socket) {
});
server1.listen(common.PORT);
server2.addListener('error', function(error) {
assert.equal(true, error.message.indexOf('EADDRINUSE') >= 0);
server1.close();
});
server2.listen(common.PORT);