Examples of NettyTCPMessageSender


Examples of org.menacheri.jetclient.communication.NettyTCPMessageSender

        .getLoginBuffer(localAddress);
    Event loginEvent = Events.event(buffer, Events.LOG_IN);
    // This will in turn invoke the startEventHandler when server sends
    // Events.START event.
    Channel channel = tcpClient.connect(tcpFactory, loginEvent);
    IReliable tcpMessageSender = new NettyTCPMessageSender(channel);
    session.setTcpMessageSender(tcpMessageSender);
  }
View Full Code Here

Examples of org.menacheri.jetclient.communication.NettyTCPMessageSender

    // This will in turn invoke the startEventHandler when server sends
    // Events.START event.
    Channel channel = tcpClient.connect(tcpFactory, event);
    if (null != channel)
    {
      Reliable tcpMessageSender = new NettyTCPMessageSender(channel);
      session.setTcpMessageSender(tcpMessageSender);
    }
    else
    {
      throw new Exception("Could not create TCP connection to server");
View Full Code Here

Examples of org.menacheri.jetserver.communication.NettyTCPMessageSender

  {
    LOG.trace("Going to clear pipeline");
    // Clear the existing pipeline
    NettyUtils.clearPipeline(channel.getPipeline());
    // Set the tcp channel on the session.
    NettyTCPMessageSender sender = new NettyTCPMessageSender(channel);
    playerSession.setTcpSender(sender);
    // Connect the pipeline to the game room.
    gameRoom.connectSession(playerSession);
    playerSession.setWriteable(true);// TODO remove if unnecessary. It should be done in start event
    // Send the re-connect event so that it will in turn send the START event.
View Full Code Here

Examples of org.menacheri.jetserver.communication.NettyTCPMessageSender

        {
          LOG.trace("Going to clear pipeline");
          // Clear the existing pipeline
          NettyUtils.clearPipeline(channel.getPipeline());
          // Set the tcp channel on the session.
          NettyTCPMessageSender sender = new NettyTCPMessageSender(channel);
          playerSession.setTcpSender(sender);
          // Connect the pipeline to the game room.
          gameRoom.connectSession(playerSession);
          // Send the connect event so that it will in turn send the START event.
          playerSession.onEvent(Events.connectEvent(sender));
View Full Code Here

Examples of org.menacheri.jetserver.communication.NettyTCPMessageSender

  }
 
  protected void handleReJoin(PlayerSession playerSession, GameRoom gameRoom, Channel channel)
  {
    // Set the tcp channel on the session.
    NettyTCPMessageSender sender = new NettyTCPMessageSender(channel);
    playerSession.setTcpSender(sender);
    // Connect the pipeline to the game room.
    gameRoom.connectSession(playerSession);
    channel.write(Events.GAME_ROOM_JOIN_SUCCESS, null);//assumes that the protocol applied will take care of event objects.
    playerSession.setWriteable(true);// TODO remove if unnecessary. It should be done in start event
View Full Code Here

Examples of org.menacheri.jetserver.communication.NettyTCPMessageSender

            "Sending GAME_ROOM_JOIN_SUCCESS to channel {} completed",
            channel.getId());
        if (future.isSuccess())
        {
          // Set the tcp channel on the session.
          NettyTCPMessageSender sender = new NettyTCPMessageSender(
              channel);
          playerSession.setTcpSender(sender);
          // Connect the pipeline to the game room.
          gameRoom.connectSession(playerSession);
          // Send the connect event so that it will in turn send the
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.