Browse Source

test: use reserved IP in test-net-connect-timeout

Use reserved IP in test-net-connect-timeout.js rather than arbitrary
IP.

PR-URL: https://github.com/nodejs/node/pull/2257
Fixes: https://github.com/nodejs/node/issues/2469
Reviewed By: Ben Noordhuis <ben@strongloop.com>
v4.0.0-rc
Rich Trott 10 years ago
parent
commit
ae8d436623
  1. 8
      test/internet/test-net-connect-timeout.js

8
test/internet/test-net-connect-timeout.js

@ -15,9 +15,11 @@ var gotConnect = false;
var T = 100; var T = 100;
// 192.0.2.1 is part of subnet assigned as "TEST-NET" in RFC 5737.
// 240.*.*.*.* is "reserved for future use" // For use solely in documentation and example source code.
var socket = net.createConnection(9999, '240.0.0.0'); // In short, it should be unreachable.
// In practice, it's a network black hole.
var socket = net.createConnection(9999, '192.0.2.1');
socket.setTimeout(T); socket.setTimeout(T);

Loading…
Cancel
Save