|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.tunnel.FragmentHandler
public class FragmentHandler
Handle fragments at the endpoint of a tunnel, peeling off fully completed I2NPMessages when they arrive, and dropping fragments if they take too long to arrive.
Nested Class Summary | |
---|---|
static interface |
FragmentHandler.DefragmentedReceiver
Receive messages out of the tunnel endpoint. |
Field Summary | |
---|---|
(package private) static byte |
MASK_EXTENDED
are there follow up headers? |
(package private) static byte |
MASK_FRAGMENTED
is this the first of a fragmented message? |
(package private) static byte |
MASK_IS_SUBSEQUENT
is this a follw up byte? |
(package private) static byte |
MASK_TYPE
how should this be delivered. |
(package private) static long |
MAX_DEFRAGMENT_TIME
don't wait more than 60s to defragment the partial message |
(package private) static short |
TYPE_LOCAL
|
(package private) static short |
TYPE_ROUTER
|
(package private) static short |
TYPE_TUNNEL
|
Constructor Summary | |
---|---|
FragmentHandler(I2PAppContext context,
FragmentHandler.DefragmentedReceiver receiver)
|
Method Summary | |
---|---|
int |
getCompleteCount()
|
int |
getFailedCount()
|
protected void |
noteCompletion(long messageId)
|
protected void |
noteFailure(long messageId,
java.lang.String status)
|
protected void |
noteReception(long messageId,
int fragmentId,
java.lang.Object status)
|
void |
receiveTunnelMessage(byte[] preprocessed,
int offset,
int length)
Receive the raw preprocessed message at the endpoint, parsing out each of the fragments, using those to fill various FragmentedMessages, and sending the resulting I2NPMessages where necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static long MAX_DEFRAGMENT_TIME
static final byte MASK_IS_SUBSEQUENT
static final byte MASK_TYPE
static final byte MASK_FRAGMENTED
static final byte MASK_EXTENDED
static final short TYPE_LOCAL
static final short TYPE_TUNNEL
static final short TYPE_ROUTER
Constructor Detail |
---|
public FragmentHandler(I2PAppContext context, FragmentHandler.DefragmentedReceiver receiver)
Method Detail |
---|
public void receiveTunnelMessage(byte[] preprocessed, int offset, int length)
public int getCompleteCount()
public int getFailedCount()
protected void noteReception(long messageId, int fragmentId, java.lang.Object status)
protected void noteCompletion(long messageId)
protected void noteFailure(long messageId, java.lang.String status)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |