class PumpedTunnelGateway extends TunnelGateway
TunnelGateway.DelayedFlush, TunnelGateway.QueuePreprocessor, TunnelGateway.Receiver, TunnelGateway.Sender| Modifier and Type | Field and Description |
|---|---|
boolean | _isInboundWhether this gateway is inbound (vs outbound) |
static String | PROP_INITIAL_OB_QUEUEProperty key for initial outbound queue size |
static String | PROP_MAX_IB_MSGS_PER_PUMPProperty key for max inbound messages per pump |
static String | PROP_MAX_IB_QUEUEProperty key for max inbound queue size |
static String | PROP_MAX_OB_MSGS_PER_PUMPProperty key for max outbound messages per pump |
_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)Constructs a PumpedTunnelGateway instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean | add(I2NPMessage msg,
Hash toRouter,
TunnelId toTunnel)Adds a message to be sent down the tunnel. |
protected boolean | add(PendingGatewayMessage cur)Adds a PendingGatewayMessage to the prequeue and notifies the pumper to process it. |
static int | getMaxIbMsgsPerPump()Get the max inbound messages per pump |
static int | getMaxObMsgsPerPump() |
boolean | pump(List<PendingGatewayMessage> queueBuf)Pumps messages from the internal prequeue into the processing queue. |
static void | setMaxIbMsgsPerPump(int val)Set the max inbound messages per pump |
static void | setMaxObMsgsPerPump(int val)Set the max outbound messages per pump |
add, getMessagesSentpublic final boolean _isInbound
public static final String PROP_INITIAL_OB_QUEUE
public static final String PROP_MAX_IB_MSGS_PER_PUMP
public static final String PROP_MAX_IB_QUEUE
public static final String PROP_MAX_OB_MSGS_PER_PUMP
public PumpedTunnelGateway(RouterContext context, TunnelGateway.QueuePreprocessor preprocessor, TunnelGateway.Sender sender, TunnelGateway.Receiver receiver, TunnelGatewayPumper pumper)
context - RouterContextpreprocessor - QueuePreprocessor responsible for preprocessing messagessender - Sender responsible for encrypting and delivering messagesreceiver - Receiver that consumes encrypted messages for forwardingpumper - TunnelGatewayPumper managing pumping threadspublic boolean add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel)
add in class TunnelGatewaymsg - the message to sendtoRouter - optional target routertoTunnel - optional target tunnelprotected boolean add(PendingGatewayMessage cur)
cur - the PendingGatewayMessage to addpublic static int getMaxIbMsgsPerPump()
public static int getMaxObMsgsPerPump()
public boolean pump(List<PendingGatewayMessage> queueBuf)
queueBuf - an empty list used as a temporary buffer for messages (will be cleared before return)public static void setMaxIbMsgsPerPump(int val)
public static void setMaxObMsgsPerPump(int val)