Class NeighborTrafficLimiter
java.lang.Object
org.ngengine.nostr4j.rtc.routing.NeighborTrafficLimiter
- All Implemented Interfaces:
AutoCloseable
Fixed-window admission control applied before routed packet parsing or
cryptographic work. State is bounded because peer identifiers are attacker
controlled.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidrecordMalformed(NodeId peer, long nowMs) tryAcquire(NodeId peer, int bytes, boolean control, long nowMs)
-
Constructor Details
-
NeighborTrafficLimiter
public NeighborTrafficLimiter()
-
-
Method Details
-
tryAcquire
public NeighborTrafficLimiter.Admission tryAcquire(NodeId peer, int bytes, boolean control, long nowMs) -
recordMalformed
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-