public class Register extends Payload
Modifier and Type | Field and Description |
---|---|
private HostItem |
hostItem |
private static int |
HOSTNAME_START_POSITION |
PAYLOAD_SIZE_POSITION, PAYLOAD_START_POSITION, requestResponseCode
Modifier | Constructor and Description |
---|---|
protected |
Register(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
|
Register(HostItem hostItem)
Constructor with hostItem (typically used by client)
|
Modifier and Type | Method and Description |
---|---|
HostItem |
getHostItem()
HostItem getter.
|
protected byte[] |
toPacket()
Returns a byte[] containing Packet with padding.
|
getPayloadSize, getRequestResponseCode, setPayloadSize
private HostItem hostItem
private static final int HOSTNAME_START_POSITION
public Register(HostItem hostItem) throws InternalError
hostItem
- Host you want to register.InternalError
protected Register(byte[] packet) throws SizeError, ProtocolError, InternalError, TransmissionError
packet
- the full Packet receivedSizeError
InternalError
ProtocolError
TransmissionError
protected byte[] toPacket() throws InternalError
toPacket
in class Payload
InternalError
public HostItem getHostItem()