class FragmentedMessage extends Object
| Constructor and Description |
|---|
FragmentedMessage(net.i2p.I2PAppContext ctx,
long messageId) |
| Modifier and Type | Method and Description |
|---|---|
void |
failed() |
int |
getCompleteSize() |
net.i2p.util.SimpleTimer2.TimedEvent |
getExpireEvent()
used in the fragment handler so we can cancel the expire event on success
|
int |
getFragmentCount() |
long |
getLifetime()
how long has this fragmented message been alive?
|
long |
getMessageId() |
boolean |
getReleased() |
long |
getReleasedAfter() |
net.i2p.data.Hash |
getTargetRouter() |
net.i2p.data.TunnelId |
getTargetTunnel() |
boolean |
isComplete()
have we received all of the fragments?
|
boolean |
receive(byte[] payload,
int offset,
int length,
boolean isLast,
net.i2p.data.Hash toRouter,
net.i2p.data.TunnelId toTunnel)
Receive the first fragment (#0) and related metadata.
|
boolean |
receive(int fragmentNum,
byte[] payload,
int offset,
int length,
boolean isLast)
Receive a followup fragment, though one of these may arrive at the endpoint
prior to the fragment # 0.
|
void |
setExpireEvent(net.i2p.util.SimpleTimer2.TimedEvent evt) |
byte[] |
toByteArray() |
String |
toString()
toString
|
public FragmentedMessage(net.i2p.I2PAppContext ctx,
long messageId)
public boolean receive(int fragmentNum,
byte[] payload,
int offset,
int length,
boolean isLast)
fragmentNum - sequence number within the message (1 - 63)payload - data for the fragment non-nulloffset - index into the payload where the fragment data starts (past headers/etc)length - how much past the offset should we snag?isLast - is this the last fragment in the message?public boolean receive(byte[] payload,
int offset,
int length,
boolean isLast,
net.i2p.data.Hash toRouter,
net.i2p.data.TunnelId toTunnel)
payload - data for the fragment non-nulloffset - index into the payload where the fragment data starts (past headers/etc)length - how much past the offset should we snag?isLast - is this the last fragment in the message?toRouter - what router is this destined for (may be null)toTunnel - what tunnel is this destined for (may be null)public long getMessageId()
public net.i2p.data.Hash getTargetRouter()
public net.i2p.data.TunnelId getTargetTunnel()
public int getFragmentCount()
public net.i2p.util.SimpleTimer2.TimedEvent getExpireEvent()
public void setExpireEvent(net.i2p.util.SimpleTimer2.TimedEvent evt)
public boolean isComplete()
public int getCompleteSize()
public long getLifetime()
public boolean getReleased()
public byte[] toByteArray()
public long getReleasedAfter()
public void failed()