Package net.i2p.router
Class RouterThrottleImpl
java.lang.Object
net.i2p.router.RouterThrottleImpl
- All Implemented Interfaces:
RouterThrottle
- Direct Known Subclasses:
RouterDoSThrottle
Simple throttle that basically stops accepting messages or nontrivial
requests if the jobQueue lag is too large.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RouterContextstatic final intstatic final longstatic final Stringstatic final Stringstatic final inttunnel acceptance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.unused, function moved to netdbbooleanShould 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...intIf we should send a reject, return a nonzero reject code.voiddoubleHow much faster (or if negative, slower) we are receiving data as opposed to our longer term averages?getTunnelStatus(), translated if available.longHow backed up we are at the moment processing messages (in milliseconds)longHow backed up our tunnels are at the moment (in milliseconds)Message on the state of participating tunnel acceptancevoidvoidsetTunnelStatus(String msg)
-
Field Details
-
_context
-
PROP_MAX_TUNNELS
- See Also:
-
DEFAULT_MAX_TUNNELS
public static final int DEFAULT_MAX_TUNNELS- See Also:
-
DEFAULT_REJECT_STARTUP_TIME
public static final long DEFAULT_REJECT_STARTUP_TIME- See Also:
-
PROP_REJECT_STARTUP_TIME
- See Also:
-
TUNNEL_ACCEPT
public static final int TUNNEL_ACCEPTtunnel acceptance- See Also:
-
-
Constructor Details
-
RouterThrottleImpl
-
-
Method Details
-
acceptNetworkMessage
public 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...- Specified by:
acceptNetworkMessagein interfaceRouterThrottle
-
acceptNetDbLookupRequest
Deprecated.unused, function moved to netdbDescription copied from interface:RouterThrottleShould we accept the netDb lookup message, replying either with the value or some closer peers, or should we simply drop it due to overload?- Specified by:
acceptNetDbLookupRequestin interfaceRouterThrottle
-
acceptTunnelRequest
public int acceptTunnelRequest()If we should send a reject, return a nonzero reject code. Anything that causes us to drop a request instead of rejecting it must go in BuildHandler.handleInboundRequest(), not here.- Specified by:
acceptTunnelRequestin interfaceRouterThrottle- Returns:
- 0 for accept or nonzero reject code
-
getMessageDelay
public long getMessageDelay()Description copied from interface:RouterThrottleHow backed up we are at the moment processing messages (in milliseconds)- Specified by:
getMessageDelayin interfaceRouterThrottle
-
getTunnelLag
public long getTunnelLag()Description copied from interface:RouterThrottleHow backed up our tunnels are at the moment (in milliseconds)- Specified by:
getTunnelLagin interfaceRouterThrottle
-
getInboundRateDelta
public double getInboundRateDelta()Description copied from interface:RouterThrottleHow much faster (or if negative, slower) we are receiving data as opposed to our longer term averages?- Specified by:
getInboundRateDeltain interfaceRouterThrottle
-
getTunnelStatus
Description copied from interface:RouterThrottleMessage on the state of participating tunnel acceptance- Specified by:
getTunnelStatusin interfaceRouterThrottle
-
getLocalizedTunnelStatus
getTunnelStatus(), translated if available.- Specified by:
getLocalizedTunnelStatusin interfaceRouterThrottle- Since:
- 0.9.45
-
setShutdownStatus
public void setShutdownStatus()- Specified by:
setShutdownStatusin interfaceRouterThrottle- Since:
- 0.8.12
-
cancelShutdownStatus
public void cancelShutdownStatus()- Specified by:
cancelShutdownStatusin interfaceRouterThrottle- Since:
- 0.8.12
-
setTunnelStatus
- Specified by:
setTunnelStatusin interfaceRouterThrottle
-