Commit 68fc6a55 by wjg

add update

parent 890f84ac
...@@ -13,6 +13,7 @@ import java.io.IOException; ...@@ -13,6 +13,7 @@ import java.io.IOException;
import java.net.NetworkInterface; import java.net.NetworkInterface;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import okhttp3.Call; import okhttp3.Call;
import okhttp3.Callback; import okhttp3.Callback;
...@@ -44,7 +45,7 @@ public class HttpUtil { ...@@ -44,7 +45,7 @@ public class HttpUtil {
} }
public static void get(String url, Handler handler) { public static void get(String url, Handler handler) {
OkHttpClient client = new OkHttpClient(); OkHttpClient client = new OkHttpClient.Builder().callTimeout(15, TimeUnit.SECONDS).readTimeout(15, TimeUnit.SECONDS).build();
Request request = new Request.Builder().url(url).get().build(); Request request = new Request.Builder().url(url).get().build();
client.newCall(request).enqueue(new Callback() { client.newCall(request).enqueue(new Callback() {
@Override @Override
......
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