SshPeek
INT SshPeek(
HCLIENT hClient,  
LPBYTE lpBuffer,  
INT cbBuffer  
);

The SshPeek function reads the specified number of bytes from the remote host and copies them into the buffer, but it does not remove the data from the internal receive 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 there is no data available to be read at that time. If the function fails, the return value is SSH_ERROR. To get extended error information, call SshGetLastError.

Remarks

The SshPeek function can be used to examine the data that is available to be read from the internal receive buffer. If there is no data in the receive buffer at that time, a value of zero is returned. It should be noted that this differs from the SshRead function, where a return value of zero indicates that there is no more data available to be read and the connection has been closed. The SshPeek function will never cause the client to block, and so may be safely used with asynchronous connections.

Requirements

Client: Requires Windows Vista, Windows XP or Windows 2000 Professional.
Server: Requires Windows Server 2008, Windows Server 2003 or Windows 2000 Server.
Header: Include cstools6.h.
Library: Use cstshav6.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

SshIsReadable, SshRead, SshSearch, SshWrite


Copyright © 2008 Catalyst Development Corporation. All rights reserved.