C# Class IrcDotNet.IrcStandardFloodPreventer

Represents a flood protector that throttles data sent by the client according to the standard rules implemented by modern IRC servers.
The principle is that no message may be sent by the client once the value of an internal counter has reached the value of MaxMessageBurst. The counter is incremented every time a message is sent, and decremented by one every duration of CounterPeriod. Hence, messages may be sent immediately in bursts so long as the high rate is not sustained, else a delay is introduced between the sending of successive messages, such that the data.
Inheritance: IIrcFloodPreventer
ファイルを表示 Open project: IrcDotNet/IrcDotNet

Public Methods

Method Description
GetSendDelay ( ) : long
HandleMessageSent ( ) : void
IrcStandardFloodPreventer ( int maxMessageBurst, long counterPeriod ) : System

Initializes a new instance of the IrcStandardFloodPreventer class.

Method Details

GetSendDelay() public method

public GetSendDelay ( ) : long
return long

HandleMessageSent() public method

public HandleMessageSent ( ) : void
return void

IrcStandardFloodPreventer() public method

Initializes a new instance of the IrcStandardFloodPreventer class.
public IrcStandardFloodPreventer ( int maxMessageBurst, long counterPeriod ) : System
maxMessageBurst int The maximum number of messages that can be sent in a burst.
counterPeriod long /// The number of milliseconds between each decrement of the message counter. ///
return System