lundi 30 mars 2015

node net socket connection timeout

I noticed, that my node server's net.createConnection() has a very long timeout before firing an error on some occasions (seems to be a particular problem with ports...)


i tried to connect to somedomain:9000 (listening, connecting and working as expected) and to somedomain:1234 (same domain, different port, waiting around 2 minutes until "connect ETIMEDOUT")


When i connect to non-existent domains, i get an error right away, but not if i connect to unreachable ports on reachable hosts. i need to determine if a machine is reachable in <1sec..


how do i handle this? Must be some way to notice an unreachable port in under 2minutes? at least some kind of timeout that just sets the address as unreachable after a set amout of time?


Thanks


Aucun commentaire:

Enregistrer un commentaire