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:


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

  1. 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



API introduced: V6R1

[ Back to top | UNIX-Type APIs | APIs by category ]