net.jxta.impl.endpoint.tcp
Class Header
java.lang.Object
|
+--net.jxta.impl.endpoint.tcp.Header
- public class Header
- extends java.lang.Object
This class implements the TCP Transport Protocol Header
The format of the header is:
1 byte: command
4 bytes: src IP
2 bytes: src port
4 bytes: size of packed (beside this header)
1 byte: option
4 bytes: packet id
Depending on the command, some of the fields may not be used. However,
the header is fixed: used fields are ignored, but transmitted.
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
cmd
public byte cmd
srcAddr
public byte[] srcAddr
srcPort
public int srcPort
size
public int size
option
public int option
packetId
public int packetId
length
public static int length
PROPAGATE
public static final int PROPAGATE
UNICAST
public static final int UNICAST
ACK
public static final int ACK
NACK
public static final int NACK
HANDCHECK
public static final int HANDCHECK
NONBLOCKING
public static final int NONBLOCKING
Header
public Header()
initFromNetwork
public boolean initFromNetwork(byte[] buffer,
int offset)
buildForNetwork
public void buildForNetwork(byte[] buffer,
int offset)