LoginRateLimiter

StockSharp.Server.Core

Rate limiter for login attempts. Tracks failed attempts per IP address and rejects connections that exceed the configured threshold within a sliding time window.

构造函数

LoginRateLimiter(int, TimeSpan?)

Initializes a new instance.

maxAttempts
Maximum failed attempts allowed within the window.
window
Sliding time window for tracking attempts.

属性

TrackedCount : int

Number of IP trackers currently held. Exposed for diagnostics and tests to verify that empty trackers are evicted and do not accumulate.

方法

IsLimited(EndPoint) : bool

Check if the given endpoint is rate-limited.

remoteEndPoint
Client endpoint.

返回值: true if the client should be rejected.

RecordFailure(EndPoint)

Record a failed login attempt for the given endpoint.

remoteEndPoint
Client endpoint.
RecordSuccess(EndPoint)

Record a successful login — clears the failure counter for the endpoint.

remoteEndPoint
Client endpoint.