Package com.esotericsoftware.kryonet.FrameworkMessage

Examples of com.esotericsoftware.kryonet.FrameworkMessage.Ping


        client.updateReturnTripTime();
      }

      public void received (Connection connection, Object object) {
        if (object instanceof Ping) {
          Ping ping = (Ping)object;
          if (ping.isReply) System.out.println("Ping: " + connection.getReturnTripTime());
          client.updateReturnTripTime();
        }
      }
    });
View Full Code Here


   * Requests the connection to communicate with the remote computer to determine a new value for the
   * {@link #getReturnTripTime() return trip time}. When the connection receives a {@link FrameworkMessage.Ping} object with
   * {@link Ping#isReply isReply} set to true, the new return trip time is available.
   */
  public void updateReturnTripTime () {
    Ping ping = new Ping();
    ping.id = lastPingID++;
    lastPingSendTime = System.currentTimeMillis();
    sendTCP(ping);
  }
View Full Code Here

      listeners[i].disconnected(this);
  }

  void notifyReceived (Object object) {
    if (object instanceof Ping) {
      Ping ping = (Ping)object;
      if (ping.isReply) {
        if (ping.id == lastPingID - 1) {
          returnTripTime = (int)(System.currentTimeMillis() - lastPingSendTime);
          if (TRACE) trace("kryonet", this + " return trip time: " + returnTripTime);
        }
View Full Code Here

        client.updateReturnTripTime();
      }

      public void received (Connection connection, Object object) {
        if (object instanceof Ping) {
          Ping ping = (Ping)object;
          if (ping.isReply) System.out.println("Ping: " + connection.getReturnTripTime());
          client.updateReturnTripTime();
        }
      }
    });
View Full Code Here

TOP

Related Classes of com.esotericsoftware.kryonet.FrameworkMessage.Ping

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.