Skip to content

Instantly share code, notes, and snippets.

@3rd-Eden
Created July 21, 2010 09:53
Show Gist options
  • Save 3rd-Eden/484285 to your computer and use it in GitHub Desktop.
Save 3rd-Eden/484285 to your computer and use it in GitHub Desktop.
Connection errors with node do not get send
> ping 10.211.55.5
PING 10.211.55.5 (10.211.55.5): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
ping: sendto: No route to host
Request timeout for icmp_seq 4
ping: sendto: Host is down
Request timeout for icmp_seq 5
ping: sendto: Host is down
Request timeout for icmp_seq 6
ping: sendto: Host is down
Request timeout for icmp_seq 7
^C
--- 10.211.55.5 ping statistics ---
9 packets transmitted, 0 packets received, 100.0% packet loss
> node test.js
ERROR CONNECTION: Error: , Host is down
> node test.js
ERROR CONNECTION: Error: , Host is down
> node test.js
ERROR CONNECTION: Error: , Host is down
> node test.js
ERROR CONNECTION: Error: , Host is down
> node test.js
ERROR CONNECTION: Error: , Host is down
> node test.js
^[[A
^[[A
^[[A
^C
^ no error response, no nothing ( ^[[A == up and enter ;) )
var Stream = require('net').Stream;
var connection = new Stream;
connection.addListener("error", function( error ){
console.log( "ERROR CONNECTION: " + error )
});
connection.addListener("connect", function( error ){
console.log( "CONNECTED TO SERVER" )
});
connection.connect(11211, "10.211.55.5")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment