The IsBlocking method is used to determine if the
socket is performing a blocking operation.
Parameters
None.
Return Value
If the socket is currently performing a blocking operation, the
method
returns a non-zero value. If the socket is not performing a blocking
operation, or the socket handle is invalid, the method returns zero.
Remarks
This method is typically used to
determine if a socket that is being used by another thread is
currently blocked. A socket may block when waiting to receive data
from a remote host or while data is actively being exchanged. Because
there can only be one blocking socket operation per thread, this
method can be used to determine if a method such as Read
or Write would fail because another thread is currently
sending or receiving data on that socket.
It is important to note that if this method returns a non-zero
value, it does not guarantee that a subsequent read or write on the
socket will succeed. The application should always check the return
value from methods such as Read and Write to
ensure they were successful.
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
IsConnected,
IsReadable,
IsWritable,
Read,
ReadLine,
Write,
WriteLine
|