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.
25 lines
485 B
25 lines
485 B
14 years ago
|
var common = require('../common');
|
||
|
var net = require('net');
|
||
|
var assert = require('assert');
|
||
|
|
||
|
|
||
|
// Hopefully nothing is running on common.PORT
|
||
|
var c = net.createConnection(common.PORT);
|
||
|
|
||
14 years ago
|
c.on('connect', function() {
|
||
|
console.error('connected?!');
|
||
14 years ago
|
assert.ok(false);
|
||
14 years ago
|
});
|
||
14 years ago
|
|
||
|
var gotError = false;
|
||
14 years ago
|
c.on('error', function(e) {
|
||
|
console.error('couldn\'t connect.');
|
||
14 years ago
|
gotError = true;
|
||
14 years ago
|
assert.equal('ECONNREFUSED', e.code);
|
||
14 years ago
|
});
|
||
|
|
||
|
|
||
14 years ago
|
process.on('exit', function() {
|
||
14 years ago
|
assert.ok(gotError);
|
||
|
});
|