getdns Functions
PHP Manual


(PECL getdns >= 0.10.0)

php_getdns_cancel_callbackCancel an existing asynchronous transaction.


int php_getdns_cancel_callback ( int $context , string $transID )

This function causes the getdns library to call the callback with a callbackType of GETDNS_CALLBACK_CANCEL if the callback for this transID has not already been called. This will cancel the callback regardless of what the original call was doing (such as in the middle of a DNS request, while DNSSEC validation is happening, and so on). The callback code for cancellation should clean up any memory related to the identified call, such as to deallocate the memory for the userArg. php_getdns_cancel_callback() may return immediately, even before the callback finishes its work and returns.



The previously created DNS context that is to be used with this request.


The transaction identifier associated with the callback to be cancelled. The identifier must be represented as a 16-character string value in hexadecimal format representing an unsigned 64-bit integer that was returned from one of the asynchronous query functions.

Return Values

This function returns an integer response code. Calling php_getdns_cancel_callback() with a transID of a callback that has already been called or an unknown transID returns GETDNS_RETURN_UNKNOWN_TRANSACTION; otherwise, php_getdns_cancel_callback() returns GETDNS_RETURN_GOOD.

getdns Functions
PHP Manual