net.i2p.router.transport.udp
class OutboundMessageState extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_MSG_SIZE |
Constructor and Description |
---|
OutboundMessageState(I2PAppContext context) |
Modifier and Type | Method and Description |
---|---|
boolean |
acked(ACKBitfield bitfield)
Ack all the fragments in the ack list.
|
void |
fragment(int fragmentSize)
Prepare the message for fragmented delivery, using no more than
fragmentSize bytes per fragment.
|
int |
fragmentSize(int fragmentNum) |
int |
getFragmentCount()
how many fragments in the message
|
int |
getFragmentSize() |
long |
getLifetime() |
int |
getMaxSends() |
OutNetMessage |
getMessage() |
long |
getMessageId() |
long |
getNextSendTime() |
PeerState |
getPeer() |
int |
getPushCount() |
int |
getUnackedSize() |
boolean |
initialize(I2NPMessage msg,
PeerState peer) |
boolean |
initialize(OutNetMessage msg) |
boolean |
initialize(OutNetMessage m,
I2NPMessage msg) |
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 |
setNextSendTime(long when) |
void |
setPeer(PeerState peer) |
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.
|
public static final int MAX_MSG_SIZE
public OutboundMessageState(I2PAppContext context)
public boolean initialize(OutNetMessage msg)
public boolean initialize(I2NPMessage msg, PeerState peer)
public boolean initialize(OutNetMessage m, I2NPMessage msg)
public 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)