CFtpClient::SetBufferSize Method  
 
INT SetBufferSize(
  INT nBufferSize  
);

The SetBufferSize method sets the size in bytes of an internal buffer that will be used during data transfers.

Parameters

nBufferSize
The size of an internal buffer, in bytes. Any value greater than or equal to zero is acceptable. If nBufferSize is zero, then the default value of 4096 will be used. If nBufferSize is less than 256 bytes, the buffer size will be set to 256. The maximum value of nBufferSize is 1048576 (1Mb).

Return Value

If the method succeeds, the return value is the size of the internal buffer that will be used. If the method fails, the return value is FTP_ERROR. To get extended error information, call GetLastError.

Remarks

The speed of data transfers, particularly on uploads, may be sensitive to network type and configuration, and the size of the internal buffer used for data transfers. The default size of this buffer will result in good performance for a wide range of network characteristics. A larger buffer will not necessarily result in better performance. For example, a multiple of 1460, which is the typical Maximum Transmission Unit (MTU), may be optimal in many situations.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header File: cstools10.h
Import Library: csftpv10.lib
Unicode: Implemented as Unicode and ANSI versions.

See Also

GetBufferSize, GetData, GetFile, PutData, PutFile