java - 如何判断URLConnection超时,自动重连?
黄舟
黄舟 2017-04-18 09:30:23
0
1
726

我想通过URLConnection下载网页源码? 因为开很多个线程下载,所以会出现超时的情况。
请问要如何处理才能保证一定下载成功呢?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
黄舟

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template