|
INT Read( |
|
LPBYTE lpBuffer, |
|
|
INT cbBuffer |
|
); |
INT Read( |
|
CString& strBuffer, |
|
|
INT cbBuffer |
|
); |
The Read method reads the specified number of bytes from
the client socket and copies them into the buffer. The data may be of
any type, and is not terminated with a null character.
Parameters
- lpBuffer
- Pointer to the buffer in which the data will be copied. An
alternate form of the method accepts a CString object which
will contain the data returned from the server.
- cbBuffer
- The maximum number of bytes to read and copy into the specified
buffer. This value must be greater than zero.
Return Value
If the method succeeds, the return value is the number of bytes
actually read. A return value of zero indicates that the server
has closed the connection and there is no more data available to be
read. If the method fails, the return value is FTP_ERROR. To get
extended error information, call GetLastError.
Remarks
When Read is called and the client is in non-blocking mode,
it is possible that the method will fail because there is no
available data to read at that time. This should not be considered a
fatal error. Instead, the application should simply wait to receive
the next asynchronous notification that data is available.
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
EnableEvents,
GetData, GetFile,
IsBlocking,
IsReadable,
IsWritable,
RegisterEvent,
Write
|
|