|
||||||||||
| 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)
|
|
| 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 |
int |
getFragmentSize()
|
long |
getLifetime()
|
int |
getMaxSends()
|
OutNetMessage |
getMessage()
|
long |
getMessageId()
|
long |
getNextSendTime()
|
PeerState |
getPeer()
|
int |
getPriority()
For CDPQ |
int |
getPushCount()
|
long |
getSeqNum()
For CDPQ |
int |
getUnackedSize()
|
boolean |
initialize(I2NPMessage msg,
PeerState peer)
Called from UDPTransport TODO make two constructors, remove this, and make more things final |
boolean |
initialize(OutNetMessage m,
I2NPMessage msg)
Called from OutboundMessageFragments TODO make two constructors, remove this, and make more things final |
boolean |
isComplete()
|
boolean |
isExpired()
|
boolean |
isFragmented()
|
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 |
setPeer(PeerState peer)
|
void |
setSeqNum(long num)
For CDPQ |
boolean |
shouldSend(int fragmentNum)
should we continue sending this fragment? |
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)
| Method Detail |
|---|
public boolean initialize(I2NPMessage msg,
PeerState peer)
IAE - if too big
public boolean initialize(OutNetMessage m,
I2NPMessage msg)
IAE - if too bigpublic void releaseResources()
public OutNetMessage getMessage()
public long getMessageId()
public PeerState getPeer()
public void setPeer(PeerState peer)
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)
public int getFragmentCount()
public int getFragmentSize()
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 CDQEntrypublic long getEnqueueTime()
getEnqueueTime in interface CDQEntrypublic void drop()
drop in interface CDQEntrypublic void setSeqNum(long num)
setSeqNum in interface PQEntrypublic long getSeqNum()
getSeqNum in interface PQEntrypublic int getPriority()
getPriority in interface PQEntrypublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||