Throwing exception if connecting takes too long.