Unfortunately, that IOException is only thrown if there is a clear
indication from the network (i.e. Connection refused/Host unreachable)
that the server isn't listening/unreachable. If the TCP connection
attempt goes completely unanswered (e.g. due to a DROP in a firewall)
openInputStream will keep hanging until it times out. The default
timeout probably varies from platform to platform, but in the emulator
(and in a number of phones) it appears to be on the order of minutes.
I haven't yet managed to find a way to either interrupt the connecting
thread or adjust the timeout. Is this even possible??