-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separates out the lookup logic for net.Socket. In the event the `host` property is an IP address, the lookup is skipped.
- Loading branch information
Showing
3 changed files
with
85 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters