public class UpdateRatio extends Payload
Modifier and Type | Field and Description |
---|---|
private HostItem |
client |
private static int |
CLIENT_PORT_START_POSITION |
private static int |
DATA_SIZE_POSITION |
private long |
dataSize |
private static int |
HOSTNAMES_START_POSITION |
private HostItem |
server |
private static int |
SERVER_PORT_START_POSITION |
PAYLOAD_SIZE_POSITION, PAYLOAD_START_POSITION, requestResponseCode
Modifier | Constructor and Description |
---|---|
protected |
UpdateRatio(byte[] packet)
Constructor (typically used by tracker) with a byte[] parameter containing the Packet received.
|
|
UpdateRatio(HostItem client,
HostItem server,
long dataSize)
Constructor with hostItem (typically used by client)
|
Modifier and Type | Method and Description |
---|---|
HostItem |
getClient()
Client getter.
|
long |
getDataSize()
dataSize getter.
|
HostItem |
getServer()
Server getter
|
protected byte[] |
toPacket()
Returns a byte[] containing Packet with padding.
|
getPayloadSize, getRequestResponseCode, setPayloadSize
private HostItem client
private HostItem server
private long dataSize
private static final int DATA_SIZE_POSITION
private static final int SERVER_PORT_START_POSITION
private static final int CLIENT_PORT_START_POSITION
private static final int HOSTNAMES_START_POSITION
public UpdateRatio(HostItem client, HostItem server, long dataSize) throws InternalError
client
- HostItem of the client application.server
- HostItem of the server application.dataSize
- size of data sent.InternalError
protected UpdateRatio(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 getClient()
public HostItem getServer()
public long getDataSize()