public class RouterThrottleImpl extends Object implements RouterThrottle
| Modifier and Type | Field and Description |
|---|---|
protected RouterContext | _context |
static int | _defaultMaxTunnelsDefault maximum tunnels, adjusted by system speed and memory. |
static int | DEFAULT_MESSAGES_PER_TUNNEL_ESTIMATEThis is the estimated number of 1 KB tunnel messages that we'll see in
10 minute lifetime of an exploratory tunnel. |
static String | PROP_MAX_TUNNELS |
static int | TUNNEL_ACCEPTtunnel acceptance |
| Constructor and Description |
|---|
RouterThrottleImpl(RouterContext context) |
| Modifier and Type | Method and Description |
|---|---|
boolean | acceptNetworkMessage()Should we accept any more data from the network for any sort of message,
taking into account our current load, or should we simply slow down?
FIXME only called by SSU Receiver, not NTCP!
FIXME should put warning on the console
FIXME or should we do this at all? We have Codel queues all over now... |
int | acceptTunnelRequest()If we should send a reject, return a nonzero reject code. |
void | cancelShutdownStatus() |
static int | getDefaultMaxTunnels() |
String | getLocalizedTunnelStatus()getTunnelStatus(), translated if available. |
long | getMessageDelay()How backed up we are at the moment processing messages (in milliseconds) |
static int | getMinBandwidthFloorPerTunnel(RouterContext ctx)Calculate a floor for per-tunnel bandwidth allocation based on
participating tunnel count and total outbound bandwidth share. |
long | getTunnelLag()How backed up our tunnels are at the moment (in milliseconds) |
String | getTunnelStatus()Message on the state of participating tunnel acceptance |
static boolean | isShuttingDown(RouterContext _context) |
static void | setDefaultMaxTunnels(int val) |
void | setShutdownStatus() |
void | setTunnelStatus(String msg)setTunnelStatus. |
protected final RouterContext _context
public static volatile int _defaultMaxTunnels
public static final int DEFAULT_MESSAGES_PER_TUNNEL_ESTIMATE
public static final String PROP_MAX_TUNNELS
public static final int TUNNEL_ACCEPT
public RouterThrottleImpl(RouterContext context)
public boolean acceptNetworkMessage()
acceptNetworkMessage in interface RouterThrottlepublic int acceptTunnelRequest()
acceptTunnelRequest in interface RouterThrottlepublic void cancelShutdownStatus()
cancelShutdownStatus in interface RouterThrottlepublic static int getDefaultMaxTunnels()
public String getLocalizedTunnelStatus()
getLocalizedTunnelStatus in interface RouterThrottlepublic long getMessageDelay()
RouterThrottlegetMessageDelay in interface RouterThrottlepublic static int getMinBandwidthFloorPerTunnel(RouterContext ctx)
public long getTunnelLag()
RouterThrottlegetTunnelLag in interface RouterThrottlepublic String getTunnelStatus()
RouterThrottlegetTunnelStatus in interface RouterThrottlepublic static boolean isShuttingDown(RouterContext _context)
public static void setDefaultMaxTunnels(int val)
public void setShutdownStatus()
setShutdownStatus in interface RouterThrottlepublic void setTunnelStatus(String msg)
setTunnelStatus in interface RouterThrottle