我想通过URLConnection下载网页源码? 因为开很多个线程下载,所以会出现超时的情况。
请问要如何处理才能保证一定下载成功呢?
黄舟2017-04-18 09:32:23
Manually access a website that does not exist and let it throw a timeout exception, and then catch the exception and judge it. If it is a timeout exception when running again, re-initiate the request.