Examples of ConnectedMessage


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

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

    }
  }

  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

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

      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

Examples of org.apache.wicket.protocol.ws.api.message.ConnectedMessage

   */
  public void broadcast(Application application, String sessionId, IKey key, IWebSocketPushMessage message)
  {
    IWebSocketSettings webSocketSettings = IWebSocketSettings.Holder.get(application);
    WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    ConnectedMessage wsMessage = new ConnectedMessage(application, sessionId, key);
    broadcaster.broadcast(wsMessage, message);
  }
View Full Code Here

Examples of org.apache.wicket.protocol.ws.api.message.ConnectedMessage

   */
  protected final void onConnect(final IWebSocketConnection connection)
  {
    IKey key = getRegistryKey();
    connectionRegistry.setConnection(getApplication(), getSessionId(), key, connection);
    broadcastMessage(new ConnectedMessage(getApplication(), getSessionId(), key));
  }
View Full Code Here

Examples of org.apache.wicket.protocol.ws.api.message.ConnectedMessage

      onMessage(webSocketHandler, binaryData);
    }
    else if (payload instanceof WebSocketConnectedPayload)
    {
      WebSocketConnectedPayload connectedPayload = (WebSocketConnectedPayload) payload;
      ConnectedMessage message = connectedPayload.getMessage();
      onConnect(message);
    }
    else if (payload instanceof WebSocketClosedPayload)
    {
      WebSocketClosedPayload connectedPayload = (WebSocketClosedPayload) payload;
View Full Code Here

Examples of org.apache.wicket.protocol.ws.api.message.ConnectedMessage

        onMessage(webSocketHandler, binaryData);
      }
      else if (wsPayload instanceof WebSocketConnectedPayload)
      {
        WebSocketConnectedPayload connectedPayload = (WebSocketConnectedPayload) wsPayload;
        ConnectedMessage message = connectedPayload.getMessage();
        onConnect(message);
      }
      else if (wsPayload instanceof WebSocketClosedPayload)
      {
        WebSocketClosedPayload closedPayload = (WebSocketClosedPayload) wsPayload;
View Full Code Here

Examples of org.apache.wicket.protocol.ws.api.message.ConnectedMessage

   */
  protected final void onConnect(final IWebSocketConnection connection)
  {
    IKey key = getRegistryKey();
    connectionRegistry.setConnection(getApplication(), getSessionId(), key, connection);
    broadcastMessage(new ConnectedMessage(getApplication(), getSessionId(), key));
  }
View Full Code Here

Examples of org.apache.wicket.protocol.ws.api.message.ConnectedMessage

   */
  public void broadcast(Application application, String sessionId, IKey key, IWebSocketPushMessage message)
  {
    WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(application);
    WebSocketPushBroadcaster broadcaster = new WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry());
    ConnectedMessage wsMessage = new ConnectedMessage(application, sessionId, key);
    broadcaster.broadcast(wsMessage, message);
  }
View Full Code Here

Examples of org.apache.wicket.protocol.ws.api.message.ConnectedMessage

   */
  protected final void onConnect(final IWebSocketConnection connection)
  {
    IKey key = getRegistryKey();
    connectionRegistry.setConnection(getApplication(), getSessionId(), key, connection);
    broadcastMessage(new ConnectedMessage(getApplication(), getSessionId(), key));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.