mirror of https://github.com/lukechilds/node.git
Browse Source
Separates out the lookup logic for net.Socket. In the event the `host` property is an IP address, the lookup is skipped. PR-URL: https://github.com/iojs/io.js/pull/1505 Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>v2.0.2
3 changed files with 85 additions and 54 deletions
@ -0,0 +1,18 @@ |
|||
var common = require('../common'); |
|||
var assert = require('assert'); |
|||
var net = require('net'); |
|||
|
|||
function check(addressType) { |
|||
var server = net.createServer(function(client) { |
|||
client.end(); |
|||
server.close(); |
|||
}); |
|||
|
|||
var address = addressType === 4 ? '127.0.0.1' : '::1'; |
|||
server.listen(common.PORT, address, function() { |
|||
net.connect(common.PORT, address).on('lookup', assert.fail); |
|||
}); |
|||
} |
|||
|
|||
check(4); |
|||
common.hasIPv6 && check(6); |
Loading…
Reference in new issue