2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-07-15 15:43:24 -04:00
|
|
|
const common = require('../common');
|
2012-02-03 18:29:58 +02:00
|
|
|
var assert = require('assert');
|
|
|
|
|
|
|
|
var net = require('net');
|
|
|
|
|
2016-02-18 15:01:12 -08:00
|
|
|
var host = '*'.repeat(256);
|
2012-02-03 18:29:58 +02:00
|
|
|
|
|
|
|
function do_not_call() {
|
|
|
|
throw new Error('This function should not have been called.');
|
|
|
|
}
|
|
|
|
|
|
|
|
var socket = net.connect(42, host, do_not_call);
|
2016-07-15 15:43:24 -04:00
|
|
|
socket.on('error', common.mustCall(function(err) {
|
2012-02-03 18:29:58 +02:00
|
|
|
assert.equal(err.code, 'ENOTFOUND');
|
2016-07-15 15:43:24 -04:00
|
|
|
}));
|
2013-05-07 11:55:12 -07:00
|
|
|
socket.on('lookup', function(err, ip, type) {
|
|
|
|
assert(err instanceof Error);
|
|
|
|
assert.equal(err.code, 'ENOTFOUND');
|
|
|
|
assert.equal(ip, undefined);
|
|
|
|
assert.equal(type, undefined);
|
|
|
|
});
|