Project JXTA

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.


Field Summary
static int ACK
           
 byte cmd
           
static int HANDCHECK
           
static int length
           
static int NACK
           
static int NONBLOCKING
           
 int option
           
 int packetId
           
static int PROPAGATE
           
 int size
           
 byte[] srcAddr
           
 int srcPort
           
static int UNICAST
           
 
Constructor Summary
Header()
           
 
Method Summary
 void buildForNetwork(byte[] buffer, int offset)
           
 boolean initFromNetwork(byte[] buffer, int offset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

Header

public Header()
Method Detail

initFromNetwork

public boolean initFromNetwork(byte[] buffer,
                               int offset)

buildForNetwork

public void buildForNetwork(byte[] buffer,
                            int offset)

Project JXTA