java.lang.Object
net.i2p.router.tunnel.InboundGatewayReceiver
- All Implemented Interfaces:
TunnelGateway.Receiver
Handle messages at the IBGW. Not used for zero-hop IBGWs.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classJob receiving one message for the next hop.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HopConfigThe hop config of this gateway.private final RouterContextThe router context.private RouterInfoThe router info of the next hop.private static final longMost time spent looking up the target.private static final intThe priority of the participating messages.Constructor Summary
ConstructorsConstructorDescriptionInboundGatewayReceiver(RouterContext ctx, HopConfig cfg) Binds the router context and hop configuration.Method Summary
All MethodsModifier and TypeMethodDescriptionThe next hop.longreceiveEncrypted(byte[] encrypted) Queue the encrypted data for delivery to the next hop.longreceiveEncrypted(byte[] encrypted, boolean alreadySearched) Queue the encrypted data for delivery, with the netDb lookup already done.
Field Details
_context
The router context._config
The hop config of this gateway._target
The router info of the next hop.MAX_LOOKUP_TIME
private static final long MAX_LOOKUP_TIMEMost time spent looking up the target.- See Also:
PRIORITY
private static final int PRIORITYThe priority of the participating messages.- See Also:
Constructor Details
InboundGatewayReceiver
Binds the router context and hop configuration.- Parameters:
ctx- the router contextcfg- the hop configuration
Method Details
receiveEncrypted
public long receiveEncrypted(byte[] encrypted) Queue the encrypted data for delivery to the next hop.- Specified by:
receiveEncryptedin interfaceTunnelGateway.Receiver- Parameters:
encrypted- the I2P message received on the inbound tunnel- Returns:
- the message unique ID
receiveEncrypted
public long receiveEncrypted(byte[] encrypted, boolean alreadySearched) Queue the encrypted data for delivery, with the netDb lookup already done.- Parameters:
encrypted- the I2P message received on the inbound tunnelalreadySearched- true if the caller has already looked the next hop up in the network database, so no further lookup and stat accounting is needed here- Returns:
- the message unique ID, or -1 if the next hop's RouterInfo is not yet known and an asynchronous lookup was started instead
getSendTo
The next hop.- Specified by:
getSendToin interfaceTunnelGateway.Receiver- Returns:
- non-null