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 |
clearNACKs() |
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.
|
OutNetMessage |
getMessage() |
long |
getMessageId() |
int |
getMessageSize()
The size of the I2NP message.
|
int |
getMinSendSize()
The minimum number of bytes we can send, which is the smallest unacked fragment we will send next.
|
int |
getNACKs() |
PeerState |
getPeer() |
int |
getPriority()
For CDPQ
|
int |
getPushCount()
The number of times we've pushed some fragments.
|
int |
getSendSize(int max)
How many bytes we can send under the max given.
|
long |
getSeqNum()
For CDPQ
|
int |
getUnackedFragments() |
int |
getUnackedSize()
As of 0.9.49, includes packet overhead
|
boolean |
hasUnsentFragments()
Is any fragment unsent?
|
int |
incrementNACKs() |
boolean |
isComplete() |
boolean |
isExpired() |
boolean |
isExpired(long now) |
boolean |
needsSending(int fragment) |
int |
push(List<PacketBuilder.Fragment> toSend)
Add fragments up to the number of bytes allowed by setAllowedSendBytes()
Side effects: Clears setAllowedSendBytes.
|
void |
setEnqueueTime(long now)
For CDQ
|
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 int incrementNACKs()
public int getNACKs()
public void clearNACKs()
public PeerState getPeer()
public boolean isExpired()
public boolean isExpired(long now)
public boolean isComplete()
public int getUnackedSize()
public int getUnackedFragments()
public boolean hasUnsentFragments()
public int getMinSendSize()
public int getSendSize(int max)
max
- the maximum number of bytes we can send, including packet overheadpublic boolean needsSending(int fragment)
public long getLifetime()
public boolean acked(ACKBitfield bitfield)
public int getMaxSends()
public int getPushCount()
public int push(List<PacketBuilder.Fragment> toSend)
toSend
- out parameterpublic 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