class PacketHandler extends Object
Packet flow: I2PSession -> MessageHandler -> PacketHandler -> ConnectionPacketHandler -> MessageInputStream.
| Constructor and Description |
|---|
PacketHandler(I2PAppContext ctx,
ConnectionManager mgr) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
displayPacket(Packet packet,
String prefix,
String suffix)
Logs the provided packet at debug level with a timestamp.
|
(package private) void |
receivePacket(Packet packet)
Receives a packet and dispatches it to the appropriate handler.
|
(package private) void |
receivePacketDirect(Packet packet,
boolean queueIfNoConn)
Processes the packet immediately, optionally queuing if no connection is found.
|
public PacketHandler(I2PAppContext ctx, ConnectionManager mgr)
void displayPacket(Packet packet, String prefix, String suffix)
packet - the packet to logprefix - text prefix (e.g., "RECV" or "UNKN")suffix - additional info appended after the packet string, may be nullvoid receivePacket(Packet packet)
packet - the packet to processvoid receivePacketDirect(Packet packet, boolean queueIfNoConn)
packet - the packet to processqueueIfNoConn - queue the packet if no matching connection exists