예제 #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()));
 }