Commit fddacb73 authored by alex yao's avatar alex yao

fix:配置网页读取超时

parent 03a0ab73
......@@ -33,6 +33,10 @@ public class DocumentLoad {
try {
// 创建 资源符对象 连接
URLConnection conn = new URL(url).openConnection();
// 设置连接超时时间,单位毫秒
conn.setConnectTimeout(5000);
// 设置读取超时时间,单位毫秒
conn.setReadTimeout(15000);
// 获取输入流
InputStream inputStream = conn.getInputStream();
// 缓冲区,读取输入流内容,64KB
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment