BOOL Cancel( |
|
SOCKET hSocket |
|
); |
Cancel a blocking operation for the specified client session.
Parameters
- hSocket
- The handle to a client socket.
Return Value
If the method succeeds, the return value is non-zero. If the method
fails, the return value is zero. To get extended error
information, call GetLastError.
Remarks
When the Cancel method is called, the blocking method will
not immediately fail. An internal flag is set which causes the
blocking operation to exit with an error. This means that the
application cannot cancel an operation and immediately perform some
other operation using the same client socket handle. Instead it must allow the calling stack to unwind,
returning back to the blocking operation before making any further
function calls.
Canceling a blocking operation for another client session may yield
unpredictable results. If you wish to terminate the client session, it
is preferable to use the Disconnect method rather than using
this method in conjunction with the Abort method.
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
Abort,
Disconnect
|