Now the client disconnects if:
1. no pingback recieved 2. isConnected has already been set to false In this case it looks to be a case where the client isn't responding correctly and the server may close the connection. Added a debog log statement at the respective place.
This commit is contained in:
parent
f57889431d
commit
968cb94f21
@ -14,6 +14,7 @@ import org.apache.logging.log4j.Logger;
|
|||||||
* how the server receives and parses messages.
|
* how the server receives and parses messages.
|
||||||
*/
|
*/
|
||||||
public class ServerPinger implements Runnable {
|
public class ServerPinger implements Runnable {
|
||||||
|
|
||||||
public static final Logger LOGGER = LogManager.getLogger();
|
public static final Logger LOGGER = LogManager.getLogger();
|
||||||
public static final BudaLogConfig l = new BudaLogConfig(LOGGER);
|
public static final BudaLogConfig l = new BudaLogConfig(LOGGER);
|
||||||
|
|
||||||
@ -50,7 +51,13 @@ public class ServerPinger implements Runnable {
|
|||||||
} else {
|
} else {
|
||||||
if (isConnected) {
|
if (isConnected) {
|
||||||
isConnected = false;
|
isConnected = false;
|
||||||
System.out.println("Lost connection to user " + c.getClientUserName() + ". Waiting to reconnect...");
|
//TODO: Possibly an incorrect statement since this can also happen if a client is not adhearing to the protocol
|
||||||
|
System.out.println(
|
||||||
|
"Lost connection to user " + c.getClientUserName() + ". Waiting to reconnect...");
|
||||||
|
} else {
|
||||||
|
c.disconnectClient();
|
||||||
|
LOGGER.debug(
|
||||||
|
"gotPingBack has not been set to true and isConnected has been set to false before");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user