me.edwards.des.net.packet
Class PacketAddr

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

public class PacketAddr
extends Packet

Address Packet

This packet is sent as a response to a PacketGetAddr with a list of the responding node's known peers. It is used in the bootstrapping process.

Created on: Oct 19, 2015 at 10:46:14 AM

Author:
Matthew Edwards

Nested Class Summary
 
Nested classes/interfaces inherited from class me.edwards.des.net.packet.Packet
Packet.PacketTypes
 
Field Summary
private  java.lang.String[] peerList
           
 
Constructor Summary
PacketAddr(java.util.ArrayList<Connection> peers)
          Creates new PacketAddr
PacketAddr(byte[] binary)
          Creates new PacketAddr from binary data
 
Method Summary
 byte[] getBinary()
          Returns the binary payload of this Packet as a byte array.
 java.lang.String[] getPeers()
          Returns this Packet's peer list
 
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

peerList

private java.lang.String[] peerList
Constructor Detail

PacketAddr

public PacketAddr(java.util.ArrayList<Connection> peers)
Creates new PacketAddr

Parameters:
peers - List of current peers

PacketAddr

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

Parameters:
binary - Packet binary data as byte array
Method Detail

getPeers

public java.lang.String[] getPeers()
Returns this Packet's peer list

Returns:
Peer list as an array of Strings

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