I expect that when setting the 'connect timeout' option, an attempt to set up a socket.io with an unreachable host (e.g. host is powered down) to fail within that time. If I misunderstood please reject this request with an explanation.
I added a timeout to Socket.prototype.handshake to make sure xhr is not attempted beyond the allowed time.
Sorry for not including a failing test, I haven't been able to get the makefile to run on my (Windows) machine. It's really simple though, just set options['connect timeout'] to 10 seconds and try to connect to a non-running server. The connection fails after 20 seconds.
Timeout if we can't establish a handshake connection within options['…