Class TunnelGateway

java.lang.Object
net.i2p.router.tunnel.TunnelGateway
Direct Known Subclasses:
PumpedTunnelGateway, TunnelGatewayZeroHop

abstract class TunnelGateway
extends Object
Serve as the gatekeeper for a tunnel, accepting messages, coalescing and/or fragmenting them before wrapping them up for tunnel delivery. The flow here is:
  1. add an I2NPMessage (and a target tunnel/router, if necessary)
  2. that message is queued up into a TunnelGateway.Pending and offered to the assigned QueuePreprocessor.
  3. that QueuePreprocessor may then take off any of the TunnelGateway.Pending messages or instruct the TunnelGateway to offer it the messages again in a short while (in an attempt to coalesce them).
  4. when the QueueProcessor accepts a TunnelGateway.Pending, it preprocesses it into fragments, forwarding each preprocessed fragment group through the Sender.
  5. the Sender then encrypts the preprocessed data and delivers it to the Receiver.
  6. the Receiver now has the encrypted message and may do with it as it pleases (e.g. wrap it as necessary and enqueue it onto the OutNetMessagePool, or if debugging, verify that it can be decrypted properly)
Unused directly - see PumpedTunnelGateway, ThrottledPumpedTunnelGateway, and TunnelGatewayZeroHop overrides.