use of im.actor.runtime.threading.CommonTimer in project actor-platform by actorapp.
the class ManagedConnection method onPongPackage.
private synchronized void onPongPackage(byte[] data) throws IOException {
DataInput dataInput = new DataInput(data);
int size = dataInput.readInt();
if (size != 8) {
Log.w(TAG, "Received incorrect pong");
throw new IOException("Incorrect pong payload size");
}
long pingId = dataInput.readLong();
// Log.d(TAG, "Received pong #" + pingId + "...");
CommonTimer timeoutTask = schedulledPings.remove(pingId);
if (timeoutTask == null) {
return;
}
timeoutTask.cancel();
refreshTimeouts();
}
use of im.actor.runtime.threading.CommonTimer in project actor-platform by actorapp.
the class ManagedConnection method onAckPackage.
// Ack
private synchronized void onAckPackage(byte[] data) throws IOException {
DataInput ackContent = new DataInput(data);
int frameId = ackContent.readInt();
CommonTimer timerCompat = packageTimers.remove(frameId);
if (timerCompat == null) {
return;
}
timerCompat.cancel();
refreshTimeouts();
}
Aggregations