Class PeerMessageLimiter
java.lang.Object
com.biglybt.core.peermanager.utils.PeerMessageLimiter
Handles incoming peer message counting/timing/stats in order to catch and block abusive peers.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
countIncomingMessage
(String message_id, int max_counts, int time_limit_ms) Add the reception of the given message to time-limited count.
-
Field Details
-
message_counts
-
-
Constructor Details
-
PeerMessageLimiter
public PeerMessageLimiter()
-
-
Method Details
-
countIncomingMessage
Add the reception of the given message to time-limited count.- Parameters:
message_id
- message to countmax_counts
- max counts allowed within the given time limittime_limit_ms
- time in ms that the count limiting applies- Returns:
- true if the added count is within acceptable time limits, false if there have been too many counts
-