class PumpedTunnelGateway extends TunnelGateway
TunnelGateway.DelayedFlush, TunnelGateway.QueuePreprocessor, TunnelGateway.Receiver, TunnelGateway.Sender
_context, _delayedFlush, _lastFlush, _log, _messagesSent, _preprocessor, _queue, _receiver, _sender
Constructor and Description |
---|
PumpedTunnelGateway(RouterContext context,
TunnelGateway.QueuePreprocessor preprocessor,
TunnelGateway.Sender sender,
TunnelGateway.Receiver receiver,
TunnelGatewayPumper pumper) |
Modifier and Type | Method and Description |
---|---|
void |
add(I2NPMessage msg,
Hash toRouter,
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).
|
protected void |
add(PendingGatewayMessage cur) |
boolean |
pump(List<PendingGatewayMessage> queueBuf)
run in one of the TunnelGatewayPumper's threads, this pulls pending messages
off the prequeue, adds them to the queue and then tries to preprocess the queue,
scheduling a later delayed flush as necessary.
|
add, getMessagesSent
public PumpedTunnelGateway(RouterContext context, TunnelGateway.QueuePreprocessor preprocessor, TunnelGateway.Sender sender, TunnelGateway.Receiver receiver, TunnelGatewayPumper pumper)
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(I2NPMessage msg, Hash toRouter, TunnelId toTunnel)
add
in class TunnelGateway
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)protected void add(PendingGatewayMessage cur)
public boolean pump(List<PendingGatewayMessage> queueBuf)
queueBuf
- Empty list for convenience, to use as a temporary buffer.
Must be empty when called; will always be emptied before return.