|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.udp.OutboundMessageState
class OutboundMessageState
Maintain the outbound fragmentation for resending, for a single message.
Field Summary | |
---|---|
static int |
MAX_MSG_SIZE
|
Constructor Summary | |
---|---|
OutboundMessageState(I2PAppContext context,
I2NPMessage msg,
PeerState peer)
Called from UDPTransport |
|
OutboundMessageState(I2PAppContext context,
OutNetMessage m,
PeerState peer)
Called from OutboundMessageFragments |
Method Summary | |
---|---|
boolean |
acked(ACKBitfield bitfield)
Ack all the fragments in the ack list. |
void |
drop()
For CDQ |
void |
fragment(int fragmentSize)
Prepare the message for fragmented delivery, using no more than fragmentSize bytes per fragment. |
int |
fragmentSize(int fragmentNum)
|
long |
getEnqueueTime()
For CDQ |
int |
getFragmentCount()
How many fragments in the message. |
long |
getLifetime()
|
int |
getMaxSends()
The max number of sends for any fragment, which is the same as the push count, at least as it's coded now. |
OutNetMessage |
getMessage()
|
long |
getMessageId()
|
int |
getMessageSize()
The size of the I2NP message. |
long |
getNextSendTime()
|
PeerState |
getPeer()
|
int |
getPriority()
For CDPQ |
int |
getPushCount()
The number of times we've pushed some fragments, which is the same as the max sends, at least as it's coded now. |
long |
getSeqNum()
For CDPQ |
int |
getUnackedSize()
|
boolean |
isComplete()
|
boolean |
isExpired()
|
boolean |
isFragmented()
Whether fragment() has been called. |
boolean |
needsSending(int fragment)
|
void |
push()
note that we have pushed the message fragments |
void |
releaseResources()
This is synchronized with writeFragment(), so we do not release (probably due to an ack) while we are retransmitting. |
void |
setEnqueueTime(long now)
For CDQ |
void |
setNextSendTime(long when)
|
void |
setSeqNum(long num)
For CDPQ |
boolean |
shouldSend(int fragmentNum)
Should we continue sending this fragment? Only valid after fragment() has been called. |
String |
toString()
|
int |
writeFragment(byte[] out,
int outOffset,
int fragmentNum)
Write a part of the the message onto the specified buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_MSG_SIZE
Constructor Detail |
---|
public OutboundMessageState(I2PAppContext context, I2NPMessage msg, PeerState peer)
IAE
- if too big or if msg or peer is nullpublic OutboundMessageState(I2PAppContext context, OutNetMessage m, PeerState peer)
IAE
- if too big or if msg or peer is nullMethod Detail |
---|
public void releaseResources()
public OutNetMessage getMessage()
public long getMessageId()
public PeerState getPeer()
public boolean isExpired()
public boolean isComplete()
public int getUnackedSize()
public boolean needsSending(int fragment)
public long getLifetime()
public boolean acked(ACKBitfield bitfield)
public long getNextSendTime()
public void setNextSendTime(long when)
public int getMaxSends()
public int getPushCount()
public void push()
public boolean isFragmented()
public void fragment(int fragmentSize)
IllegalStateException
- if called more than oncepublic int getFragmentCount()
public int getMessageSize()
public boolean shouldSend(int fragmentNum)
public int fragmentSize(int fragmentNum)
public int writeFragment(byte[] out, int outOffset, int fragmentNum)
out
- target to writeoutOffset
- into outOffset to begin writingfragmentNum
- fragment to write (0 indexed)
public void setEnqueueTime(long now)
setEnqueueTime
in interface CDQEntry
public long getEnqueueTime()
getEnqueueTime
in interface CDQEntry
public void drop()
drop
in interface CDQEntry
public void setSeqNum(long num)
setSeqNum
in interface PQEntry
public long getSeqNum()
getSeqNum
in interface PQEntry
public int getPriority()
getPriority
in interface PQEntry
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |