[Change]修改超时时间

This commit is contained in:
xinfengkun
2022-04-08 15:39:41 +08:00
parent fa495ab6a5
commit 4013e7acee
2 changed files with 6 additions and 6 deletions

View File

@@ -124,7 +124,7 @@ public class IPCFixationIPHelper {
public void run() {
start(ips);
}
}, 5 * 1000L);//延时
}, 4 * 1000L);//延时
}
}
}
@@ -135,7 +135,7 @@ public class IPCFixationIPHelper {
Process p;
try {
//ping -c 3 -w 100 中 -c 是指ping的次数 3是指ping 3次 -w 100 以秒为单位指定超时间隔是指超时时间为100秒
p = Runtime.getRuntime().exec("ping -c 2 -w 5 " + str);
p = Runtime.getRuntime().exec("ping -c 2 -w 2 " + str);
int status = p.waitFor();
InputStream input = p.getInputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(input));

View File

@@ -77,9 +77,9 @@ public class FpgaSocket implements IWebSocket {
}
if (okBuilder == null) {
okBuilder = new OkHttpClient.Builder();
okBuilder.writeTimeout(5, TimeUnit.SECONDS)
.readTimeout(5, TimeUnit.SECONDS)
.connectTimeout(5, TimeUnit.SECONDS);
okBuilder.writeTimeout(4, TimeUnit.SECONDS)
.readTimeout(4, TimeUnit.SECONDS)
.connectTimeout(1, TimeUnit.SECONDS);
}
if (client == null) {
client = okBuilder.build();
@@ -117,7 +117,7 @@ public class FpgaSocket implements IWebSocket {
if (isReconnect) {
if (!isUserCloseWebSocket) {
try {
Thread.sleep(5000L);
Thread.sleep(2000L);
} catch (InterruptedException e) {
e.printStackTrace();
}