Removed interruption from pinger

This commit is contained in:
Seraina 2022-04-09 11:52:20 +02:00
parent 67cd93403a
commit d45d64a9c7

View File

@ -38,17 +38,10 @@ public class ClientPinger implements Runnable {
Thread.currentThread().setPriority(10);
try {
Thread.sleep(20000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
while (socket.isConnected() && !socket.isClosed()) {
gotPingBack = false;
client.sendMsgToServer(Protocol.pingFromClient);
try {
Thread.sleep(4000);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
if (gotPingBack) {
if (!isConnected) { //if !isConnected, then the connection had been lost before.
isConnected = true;
@ -62,6 +55,9 @@ public class ClientPinger implements Runnable {
}
}
isConnected = false;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
public void setGotPingBack(boolean gotPingBack) {