QsoCancelOperation()--Cancel an I/O Operation
Syntax
#include <qsoasync.h> int QsoCancelOperation(int socketDescriptor, unsigned long long operationId)
Service Program Name: QSOSRV3
Default Public Authority: *USE
Threadsafe: Yes
The QsoCancelOperation() function is used to cancel one or more asynchronous I/O operations that are pending on the socket. Pending operations are defined as incomplete operations that have not been posted to an I/O completion port. The canceled operations will be posted to the I/O completion port with an errnoValue of ECANCELED.
If any operations that match the operation identifier are uninterruptible, then no pending operations will be cancelled. The only operation that is uninterruptible is gsk_secure_soc_startInit() when secure negotiations have already begun.
Parameters
- int socketDescriptor (Input)
- The socket descriptor where the operation was started.
- unsigned long long operationId (Input)
- The operation identifier that was specified in field operationId in the Qso_OverlappedIO_t structure when the operation was started.
- All pending operations on the socket that match the operationId will be cancelled.
Authorities
No authorization is required.
Return Values
QsoCancelOperation() returns an integer. Possible values are:
- -1 - The function did not complete because an error occurred. Inspect the errno value to determine the cause of the failure.
- 0 - An operation matching the operation identifier was not pending and could not be cancelled.
- >0 - Successful, at least one operation was cancelled. The return value is the number of operations cancelled.
Errno Conditions
When QsoCancelOperation() fails, errno can be set to one of the following:
[EAGAIN] | At least one pending operation was uninterruptible.
If there were multiple operations pending, none were cancelled. |
[EBADF] | Invalid descriptor. |
[ENOTSOCK] | The specified descriptor is not a socket. |
[EUNKNOWN] | Unknown system state. |
Error Messages
Message ID | Error Message Text |
---|---|
CPFA081 E | Unable to set return value or error code. |
CPE3418 E | Possible APAR condition or hardware failure. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
Usage Notes
-
When QsoCancelOperation() fails with EAGAIN for multiple pending
operations, the application may retry QsoCancelOperation() and some
pending operations may yet be cancelled after the uninterruptible operation has
completed. Or the application may close() the socket to force all
pending operations to be cancelled.
Related Information
-
QsoCreateIOCompletionPort()--Create I/O
Completion Port
-
QsoDestroyIOCompletionPort()--Destroy
I/O Completion Port
-
gsk_secure_soc_startInit()--Start Asynchronous Operation to Negotiate a Secure Session
-
gsk_secure_soc_startRecv--Start Asynchronous Receive Operation on a Secure Session
-
gsk_secure_soc_startSend--Start Asynchronous Send Operation on a Secure Session
-
QsoGenerateOperationId()--Get an I/O
Operation ID
-
QsoIsOperationPending()--Check if an I/O
Operation is Pending
-
QsoStartRecv--Start Asynchronous Receive Operation
-
QsoStartSend--Start Asynchronous Send Operation
- QsoWaitForIOCompletion()--Wait for I/O Completion Operation
API introduced: V6R1