ThrottledPumpedTunnelGateway
class PumpedTunnelGateway extends TunnelGateway
TunnelGateway.DelayedFlush, TunnelGateway.QueuePreprocessor, TunnelGateway.Receiver, TunnelGateway.Sender
_context, _delayedFlush, _lastFlush, _log, _messagesSent, _preprocessor, _queue, _receiver, _sender
コンストラクタ | 説明 |
---|---|
PumpedTunnelGateway(RouterContext context,
TunnelGateway.QueuePreprocessor preprocessor,
TunnelGateway.Sender sender,
TunnelGateway.Receiver receiver,
TunnelGatewayPumper pumper) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
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(java.util.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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
クラス内 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(java.util.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.