getdns Functions
PHP Manual


(PECL getdns >= 0.10.0)

php_getdns_context_set_idle_timeoutSet the idle connection timeout value for DNS transports.


int php_getdns_context_set_idle_timeout ( int $context , string $value )

This function can be used to set the number of milliseconds for the getdns library to leave an idle TCP, TLS, or STARTTLS connection open. "Idle" means no outstanding responses and no pending queries.



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


The number of milliseconds for the getdns library to leave idle transport connections open. The default is zero (0).

The getdns library uses an unsigned 64-bit integer to represent the timeout value. PHP does not have native support for unsigned 64-bit integers, so a character string representation of the value in hexadecimal format is used to pass the value between PHP user space and getdns. For example, "2710" is used to represent 10,000 milliseconds. The character string must contain no more than 16 characters. Padding with leading zeros (0) is acceptable.

Return Values

This function returns an integer response code. GETDNS_RETURN_GOOD indicates successful completion.

getdns Functions
PHP Manual