Add timeout to socket, so we don't hang on unavailable hosts.