|
BOOL IsReadable( |
|
SOCKET hSocket |
|
); |
BOOL IsReadable( |
|
SOCKET hSocket, |
|
|
INT nTimeout, |
|
|
LPDWORD lpdwAvail |
|
); |
The IsReadable method is used to determine if data is
available to be read from the client.
Parameters
- hSocket
- An optional parameter that specifies the handle to the client socket.
If this parameter is omitted, the socket handle for the active
client session will be used. If this method is called outside of a
server event handler, the socket handle must be specified.
- nTimeout
- Timeout for remote host response, in seconds. A value of zero
specifies that the connection should be polled without blocking the
current thread.
- lpdwAvail
- A pointer to an unsigned integer which will contain the
number of bytes available to read. This parameter may be NULL if
this information is not required.
Return Value
If the server can read data from the client within the
specified timeout period, the method returns a non-zero value. If there
is no data available to be read, the method returns zero.
Remarks
On some platforms, this value will not exceed the size of the
receive buffer (typically 64K bytes). Because of differences between
TCP/IP stack implementations, it is not recommended that your
application exclusively depend on this value to determine the exact
number of bytes available. Instead, it should be used as a general
indicator that there is data available to be read.
If the connection is secure, the value returned
in lpdwAvail will reflect the number of bytes available in the
encrypted data stream. The actual amount of data available to the
application after it has been decrypted will vary.
Requirements
Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include cswsock10.h
Import Library: cswskv10.lib
See Also
IsWritable,
Peek,
Read,
ReadLine,
ReadStream
|
|