| INT WINAPI SshRead(
|
| |
HCLIENT hClient, |
|
| |
LPBYTE lpBuffer, |
|
| |
INT cbBuffer |
|
| );
|
The SshRead function 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-byte.
Parameters
- hClient
- Handle to the client session.
- lpBuffer
- Pointer to the buffer in which the data will be copied.
- 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 function 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 function fails, the return value is
SSH_ERROR. To get extended error information, call
SshGetLastError.
Remarks
When SshRead is called and the client is in non-blocking
mode, it is possible that the function 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
Client: Requires Windows 7, Windows Vista or Windows
XP.
Server: Requires Windows Server 2008 or Windows Server
2003.
Header: Include cstools7.h.
Library: Use cstshav7.lib.
Unicode: Implemented as Unicode and ANSI versions.
See Also
SshIsReadable, SshPeek, SshReadLine, SshSearch, SshWrite, SshWriteLine
|