PowerTCP FTP for .NET
MaxRate Property
Example 



Gets or sets the maximum transfer rate of the Ftp component in bytes per second.
Syntax
<DefaultValueAttribute(0)>
Public Property MaxRate As Integer
Dim instance As FtpSession
Dim value As Integer
 
instance.MaxRate = value
 
value = instance.MaxRate
[DefaultValue(0)]
public int MaxRate {get; set;}
[DefaultValue(0)]
public:
property int MaxRate {
   int get();
   void set (    int value);
}

Property Value

An integer value indicating the desired speed of transfer in bytes per second. The default is 0.
Remarks

The default value of 0 indicates that all available bandwidth will be used.

This property is used to throttle the speed of data transfer and can be changed during a transfer.

Example
The following example demonstrates setting the maximum transfer rate, to throttle file transfers.
/// <summary>
/// Limits the transfer rate of the provided Ftp instance
/// </summary>
/// <param name="myFtp">Ftp instance to throttle transfer rate for</param>
/// <param name="maxRate">Transfer rate limit, in bytes per second</param>
public void ThrottleFtp(Ftp myFtp, int maxRate)
{
    myFtp.Session.MaxRate = maxRate;
}
''' <summary>
''' Limits the transfer rate of the provided Ftp instance
''' </summary>
''' <param name="myFtp">Ftp instance to throttle transfer rate for</param>
''' <param name="maxRate">Transfer rate limit, in bytes per second</param>
Public Sub ThrottleFtp(ByVal myFtp As Ftp, ByVal maxRate As Integer)
    myFtp.Session.MaxRate = maxRate
End Sub
See Also

Reference

FtpSession Class
FtpSession Members


PowerTCP FTP for .NET Documentation Version 6.1
© 2023 Dart Communications. All Rights Reserved.
Send comments on this topic