me.edwards.des.net.packet
Class PacketPong

java.lang.Object
  extended by me.edwards.des.net.packet.Packet
      extended by me.edwards.des.net.packet.PacketPong

public class PacketPong
extends Packet

Pong Packet

This packet is sent as a response to a PacketPing.

Created on: Oct 17, 2015 at 9:12:01 AM

Author:
Matthew Edwards

Nested Class Summary
 
Nested classes/interfaces inherited from class me.edwards.des.net.packet.Packet
Packet.PacketTypes
 
Field Summary
private  long ping
           
 
Constructor Summary
PacketPong(byte[] binary)
          Creates new PacketPong from binary data
PacketPong(long ping)
          Creates new PacketPong
 
Method Summary
 byte[] getBinary()
          Returns the binary payload of this Packet as a byte array.
 long getPing()
          Returns the Nonce for checking pong.
 
Methods inherited from class me.edwards.des.net.packet.Packet
getID, lookup, toHex, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ping

private long ping
Constructor Detail

PacketPong

public PacketPong(long ping)
Creates new PacketPong

Parameters:
ping - Nonce for checking pong

PacketPong

public PacketPong(byte[] binary)
Creates new PacketPong from binary data

Parameters:
binary - Packet binary data
Method Detail

getPing

public long getPing()
Returns the Nonce for checking pong. Should be one more than the nonce used by the Ping Packet.

Returns:
Nonce for checking pong

getBinary

public byte[] getBinary()
Description copied from class: Packet
Returns the binary payload of this Packet as a byte array.

Specified by:
getBinary in class Packet
Returns:
Binary payload as a byte array