use of com.tvd12.ezyfoxserver.client.event.EzyLostPingEvent in project ezyfox-server-android-client by youngmonkeys.
the class EzyPingSchedule method sendPingRequest.
private void sendPingRequest() {
int lostPingCount = pingManager.increaseLostPingCount();
int maxLostPingCount = pingManager.getMaxLostPingCount();
if (lostPingCount >= maxLostPingCount) {
client.getSocket().disconnect(EzyDisconnectReason.SERVER_NOT_RESPONDING.getId());
} else {
EzyRequest request = new EzyPingRequest();
client.send(request);
}
if (lostPingCount > 1) {
EzyLogger.info("lost ping count: " + lostPingCount);
EzyLostPingEvent event = new EzyLostPingEvent(lostPingCount);
socketEventQueue.addEvent(event);
}
}
Aggregations