abstract class TunnelGateway extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
TunnelGateway.DelayedFlush |
static interface |
TunnelGateway.QueuePreprocessor |
static interface |
TunnelGateway.Receiver |
static interface |
TunnelGateway.Sender |
| Modifier and Type | Field and Description |
|---|---|
protected RouterContext |
_context |
protected TunnelGateway.DelayedFlush |
_delayedFlush |
protected long |
_lastFlush |
protected net.i2p.util.Log |
_log |
protected int |
_messagesSent |
protected TunnelGateway.QueuePreprocessor |
_preprocessor |
protected List<PendingGatewayMessage> |
_queue |
protected TunnelGateway.Receiver |
_receiver |
protected TunnelGateway.Sender |
_sender |
| Modifier | Constructor and Description |
|---|---|
protected |
TunnelGateway(RouterContext context,
TunnelGateway.QueuePreprocessor preprocessor,
TunnelGateway.Sender sender,
TunnelGateway.Receiver receiver) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(I2NPMessage msg,
net.i2p.data.Hash toRouter,
net.i2p.data.TunnelId toTunnel)
Add a message to be sent down the tunnel, either sending it now (perhaps
coallesced with other pending messages) or after a brief pause (_flushFrequency).
|
void |
add(TunnelGatewayMessage msg)
Add a message to be sent down the tunnel, where we are the inbound gateway.
|
int |
getMessagesSent() |
protected final RouterContext _context
protected final net.i2p.util.Log _log
protected final List<PendingGatewayMessage> _queue
protected final TunnelGateway.QueuePreprocessor _preprocessor
protected final TunnelGateway.Sender _sender
protected final TunnelGateway.Receiver _receiver
protected long _lastFlush
protected final TunnelGateway.DelayedFlush _delayedFlush
protected int _messagesSent
protected TunnelGateway(RouterContext context, TunnelGateway.QueuePreprocessor preprocessor, TunnelGateway.Sender sender, TunnelGateway.Receiver receiver)
preprocessor - this pulls Pending messages off a list, builds some
full preprocessed messages, and pumps those into the sendersender - this takes a preprocessed message, encrypts it, and sends it to
the receiverreceiver - this receives the encrypted message and forwards it off
to the first hoppublic void add(TunnelGatewayMessage msg)
msg - message received to be sent through the tunnelpublic void add(I2NPMessage msg, net.i2p.data.Hash toRouter, net.i2p.data.TunnelId toTunnel)
msg - message to be sent through the tunneltoRouter - router to send to after the endpoint (or null for endpoint processing)toTunnel - tunnel to send to after the endpoint (or null for endpoint or router processing)public int getMessagesSent()