SocketTools .NET Edition

FtpServer.Throttle Method (Int32)

Limit the maximum number of client connections.

[Visual Basic]
Overloads Public Function Throttle( _
   ByVal maxClients As Integer _
) As Boolean
[C#]
public bool Throttle(
   int maxClients
);

Parameters

maxClients
An integer value that specifies the maximum number of clients that may connect to the server. A value of zero specifies that there is no fixed limit to the number of client connections.

Return Value

A boolean value which specifies if the method was successful. A return value of true indicates success. If an error occurs, the method returns false and the application should check the value of the LastError property to determine the cause of the failure.

Remarks

If the maximum number of client connections or maximum number of connections per address is exceeded, the server will reject subsequent connection attempts until the number of active client sessions drops below the specified threshold. Note that adjusting these values lower than the current connection limits will not affect clients that have already connected to the server. For example, if the Start method is called with the maximum number of clients set to 100, and then the Throttle method is called lowering that value to 75, no existing client connections will be affected by the change. However, the server will not accept any new connections until the number of active clients drops below 75.

See Also