Have two timeouts for the queries, one for connecting,
and another for the data download. For example, you
might want it to give up on a site if it doesn't get
any response after 30 seconds, but if it does start
sending data then you might be happy to wait longer if
you know you are going to get a successful result.