|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--inria.net.lrmp.LrmpPacket
encapsulates an LRMP data packet. Applications should use this object to send data to and receive data from LRMP. LRMP provides packet-level reliability, i.e., a packet can be sent either reliably or at best effort. The packet reliability should be specified at creation.
Packet segmentation/reassembly is not supported. Upper layers should properly segment large data blocks to LRMP packets.
Application data is contained in the buffer returned by the method getDataBuffer() and starts at the offset returned by the method getOffset().
When sending a packet, application data should be filled from this offset with the maximum length returned by getMaxDataLength(). The effective length of application data should be set using setDataLength().
When a packet is received, the application data length can be obtained by getDataLength().
Field Summary | |
protected byte[] |
buff
the data buffer. |
protected int |
datalen
the length of application data in the packet. |
protected boolean |
end
the end marker. |
protected static int |
endBit
|
protected boolean |
first
the start marker. |
protected int |
maxDataLen
the maximum length (bytes) available in the allocated buffer for application data. |
static int |
MTU
LRMP maximum transmission unit including the packet header. |
protected int |
offset
offset to application data. |
protected static int |
padBit
|
protected long |
rcvSendTime
time of transmission. |
protected boolean |
reliable
per-packet reliability, default value is true. |
protected boolean |
retransmit
retransmission flag. |
protected int |
retransmitID
retransmission id. |
protected int |
scope
scope of transmission. |
protected LrmpEntity |
sender
The packet sender. |
protected long |
seqno
sequence number. |
protected LrmpEntity |
source
The original packet sender. |
protected static int |
strtBit
|
Constructor Summary | |
|
LrmpPacket()
Constructs a reliable LrmpPacket. |
|
LrmpPacket(boolean reliable)
Constructs an LrmpPacket. |
protected |
LrmpPacket(boolean reliable,
byte[] buff,
int offset,
int len)
Constructs an LrmpPacket from received data. |
|
LrmpPacket(boolean reliable,
int length)
Constructs an LrmpPacket. |
|
LrmpPacket(int length)
Constructs a reliable LrmpPacket. |
Method Summary | |
protected void |
appendNack(inria.net.lrmp.LrmpLossEvent ev)
|
protected void |
appendNack(inria.net.lrmp.LrmpLossEvent[] evs)
|
protected void |
appendNackReply(inria.net.lrmp.LrmpLossEvent ev,
LrmpSender whoami,
int firstReply,
int bitmReply)
|
protected void |
appendReceiverReport(LrmpSender sender,
LrmpSender whoami)
|
protected void |
appendRRSelection(LrmpSender whoami,
int prob,
int period)
|
protected void |
appendSenderReport(LrmpSender whoami)
|
java.lang.Object |
clone()
Creates a new object of the same class as this object. |
protected boolean |
equals(LrmpPacket pack)
|
protected int |
formatDataPacket(boolean resend)
|
java.net.InetAddress |
getAddress()
Returns the network address of the original packet sender. |
byte[] |
getDataBuffer()
Returns the data buffer. |
int |
getDataLength()
Returns the length of application data. |
int |
getMaxDataLength()
Returns the maximum length available for application data in the buffer. |
int |
getOffset()
Returns the offset to application data. |
LrmpEntity |
getSource()
Returns the packet source, i.e., the original packet sender. |
int |
getSourceID()
Returns the identifier of the original packet sender. |
boolean |
isFirst()
Deprecated. it is removed. |
boolean |
isFirstOfBlock()
Deprecated. it is removed. |
boolean |
isLast()
Deprecated. it is removed. |
boolean |
isLastOfBlock()
Deprecated. it is removed. |
boolean |
isReliable()
Returns the reliable flag. |
void |
setDataLength(int i)
Sets the length of application data. |
void |
setFirst(boolean f)
Deprecated. it is removed. |
void |
setLast(boolean f)
Deprecated. it is removed. |
protected void |
setReliable(boolean b)
sets the reliable flag. |
protected void |
setSource(LrmpEntity s)
prepares the packet to be delivered to the application. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int padBit
protected static final int strtBit
protected static final int endBit
public static final int MTU
protected LrmpEntity source
protected LrmpEntity sender
protected byte[] buff
protected int offset
protected int datalen
protected int maxDataLen
protected boolean reliable
protected boolean first
protected boolean end
protected long seqno
protected int scope
protected long rcvSendTime
protected boolean retransmit
protected int retransmitID
Constructor Detail |
public LrmpPacket()
public LrmpPacket(boolean reliable)
reliable
- the reliability.public LrmpPacket(int length)
length
- the length of application data.public LrmpPacket(boolean reliable, int length)
reliable
- the reliability.length
- the application data length.protected LrmpPacket(boolean reliable, byte[] buff, int offset, int len)
buff
- the data buffer.offset
- the offset.len
- the packet length including the packet header.Method Detail |
public void setDataLength(int i)
i
- the length of application data in number of bytes.public int getOffset()
public int getMaxDataLength()
public int getDataLength()
public byte[] getDataBuffer()
public java.net.InetAddress getAddress()
public LrmpEntity getSource()
public int getSourceID()
public boolean isReliable()
public void setFirst(boolean f)
public void setLast(boolean f)
public boolean isFirstOfBlock()
public boolean isLastOfBlock()
public boolean isFirst()
public boolean isLast()
protected void setReliable(boolean b)
protected void setSource(LrmpEntity s)
protected int formatDataPacket(boolean resend)
protected void appendNack(inria.net.lrmp.LrmpLossEvent[] evs)
protected void appendNack(inria.net.lrmp.LrmpLossEvent ev)
protected void appendNackReply(inria.net.lrmp.LrmpLossEvent ev, LrmpSender whoami, int firstReply, int bitmReply)
protected void appendSenderReport(LrmpSender whoami)
protected void appendRRSelection(LrmpSender whoami, int prob, int period)
protected void appendReceiverReport(LrmpSender sender, LrmpSender whoami)
protected boolean equals(LrmpPacket pack)
public java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.