final int lastFailedHeartBeat = failedHeartBeat;
failedHeartBeat = 0;
if (lastFailedHeartBeat != 0) {
if (lastFailedHeartBeat >= connectionManager.maxFailedHeartbeatCount) {
try {
final RemoveAllListeners request = new RemoveAllListeners();
final ICompletableFuture future = invocationService.send(request, ClientConnection.this);
future.get(HEART_ATTACK_CLEANUP_TIMEOUT, TimeUnit.MILLISECONDS);
} catch (Exception e) {
logger.warning("Clearing listeners upon recovering from heart-attack failed", e);
}