diff options
Diffstat (limited to 'test/common.js')
-rw-r--r-- | test/common.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/common.js b/test/common.js index 622b0a398..757b59e98 100644 --- a/test/common.js +++ b/test/common.js @@ -298,3 +298,11 @@ exports.isValidHostname = function(str) { return !!str.match(re) && str.length <= 255; } + +exports.hasMultiLocalhost = function hasMultiLocalhost() { + var TCP = process.binding('tcp_wrap').TCP; + var t = new TCP(); + var ret = t.bind('127.0.0.2', exports.PORT); + t.close(); + return ret === 0; +}; |