Use try-catch for connect timeout exception if waiting.