Modifier and Type | Field and Description |
---|---|
static int |
MAX_MSG_SIZE |
Constructor and Description |
---|
OutboundMessageState(I2PAppContext context,
I2NPMessage msg,
PeerState peer)
"injected" message from the establisher.
|
OutboundMessageState(I2PAppContext context,
OutNetMessage m,
PeerState peer)
Normal constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acked(ACKBitfield bitfield)
Ack all the fragments in the ack list.
|
void |
drop()
For CDQ
|
int |
fragmentSize(int fragmentNum)
The size in bytes of the fragment
|
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 |
needsSending(int fragment) |
boolean |
push()
Note that we have pushed the message fragments.
|
void |
setEnqueueTime(long now)
For CDQ
|
void |
setNextSendTime(long when) |
void |
setSeqNum(long num)
For CDPQ
|
String |
toString() |
int |
writeFragment(byte[] out,
int outOffset,
int fragmentNum)
Write a part of the the message onto the specified buffer.
|
public static final int MAX_MSG_SIZE
public OutboundMessageState(I2PAppContext context, I2NPMessage msg, PeerState peer)
IllegalArgumentException
- if too big or if msg or peer is nullpublic OutboundMessageState(I2PAppContext context, OutNetMessage m, PeerState peer)
IllegalArgumentException
- if too big or if msg or peer is nullpublic 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 boolean push()
public int getFragmentCount()
public int getMessageSize()
public int fragmentSize(int fragmentNum)
fragmentNum
- the number of the fragmentpublic 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 setSeqNum(long num)
public long getSeqNum()
public int getPriority()
getPriority
in interface PQEntry