Merge remote-tracking branch 'origin/Jonas_Stuff' into Jonas_Stuff

This commit is contained in:
Seraina 2022-03-27 17:49:52 +02:00
commit 55a5fe50b7
2 changed files with 4 additions and 2 deletions

View File

@ -31,12 +31,13 @@ public class ClientPinger implements Runnable {
@Override
public void run() {
try {
Thread.sleep(2000);
while (socket.isConnected()) {
gotPingBack = false;
out.write("CPING");
out.newLine();
out.flush();
Thread.sleep(5000);
Thread.sleep(4000);
if (gotPingBack) {
if (!isConnected) { //if !isConnected, then the connection had been lost before.
isConnected = true;

View File

@ -31,12 +31,13 @@ public class ServerPinger implements Runnable {
@Override
public void run() {
try {
Thread.sleep(2000);
while (socket.isConnected()) {
gotPingBack = false;
out.write("SPING");
out.newLine();
out.flush();
Thread.sleep(5000);
Thread.sleep(4000);
if (gotPingBack) {
if (!isConnected) { //if !isConnected, then the connection had been lost before.
isConnected = true;