Package asia.stampy.server.message.connected

Examples of asia.stampy.server.message.connected.ConnectedMessage


   * stampy.common.message.StampyMessage, asia.stampy.common.HostPort)
   */
  @Override
  public void messageReceived(StampyMessage<?> message, HostPort hostPort) throws Exception {
    log.debug("Received connect message {} from {}", message, hostPort);
    ConnectedMessage cm = (ConnectedMessage) message;

    int requested = cm.getHeader().getIncomingHeartbeat();

    if (requested <= 0 || gateway.getHeartbeat() <= 0) return;

    int heartbeat = Math.max(requested, gateway.getHeartbeat());

View Full Code Here


    }
  }

  private void sendConnected(ConnectHeader header, HostPort hostPort) throws InterceptException {
    log.debug("Sending connected message to {}", hostPort);
    ConnectedMessage message = new ConnectedMessage("1.2");

    int requested = message.getHeader().getIncomingHeartbeat();
    if (requested >= 0 || getGateway().getHeartbeat() >= 0) {
      int heartbeat = Math.max(requested, getGateway().getHeartbeat());
      message.getHeader().setHeartbeat(heartbeat, header.getOutgoingHeartbeat());
    }
    message.getHeader().setSession(hostPort.toString());

    getGateway().sendMessage(message, hostPort);
    log.debug("Sent connected message to {}", hostPort);
  }
View Full Code Here

      break;
    case CONNECT:
      message = (MSG) new ConnectMessage();
      break;
    case CONNECTED:
      message = (MSG) new ConnectedMessage();
      break;
    case DISCONNECT:
      message = (MSG) new DisconnectMessage();
      break;
    case ERROR:
View Full Code Here

TOP

Related Classes of asia.stampy.server.message.connected.ConnectedMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.