Пример #1
0
 @Override
 public void onDisconnect(BaseClient client) {
   Set<Long> callbackIds = clientCallbackIds.remove(client.getSessionId());
   if (callbackIds != null) {
     ackCallbacks.keySet().removeAll(callbackIds);
   }
 }
 public void onDisconnect(BaseClient client) {
   log.debug("Client with sessionId: {} disconnected", client.getSessionId());
   heartbeatHandler.onDisconnect(client);
   ackManager.onDisconnect(client);
   xhrPollingTransport.onDisconnect(client);
   webSocketTransport.onDisconnect(client);
   authorizeHandler.onDisconnect(client);
 }
Пример #3
0
  public void onHeartbeat(final BaseClient client) {
    if (!configuration.isHeartbeatsEnabled()) {
      return;
    }

    final SchedulerKey key = new SchedulerKey(Type.HEARBEAT_TIMEOUT, client.getSessionId());
    // cancel heartbeat check because the client answered
    scheduler.cancel(key);
    scheduler.schedule(
        new Runnable() {
          public void run() {
            client.send(new Packet(PacketType.HEARTBEAT));
            scheduleClientHeartbeatCheck(client, key);
          }
        },
        configuration.getHeartbeatInterval(),
        TimeUnit.SECONDS);
  }
Пример #4
0
 @Override
 public void onDisconnect(BaseClient client) {
   scheduler.cancel(new SchedulerKey(Type.HEARBEAT_TIMEOUT, client.getSessionId()));
 }