0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 23:43:09 +01:00
nodejs/test/simple/test-net-eaddrinuse.js
2010-12-05 09:28:18 -08:00

15 lines
394 B
JavaScript

var common = require('../common');
var assert = require('assert');
var 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);