options
Options allows certain internal resolver variables to
be modified. The syntax is
options option ...
where option is one of the following:
...
timeout:n
sets the amount of time the resolver will wait for a
response from a remote name server before retrying the
query via a different name server. Measured in seconds,
the default is RES_TIMEOUT (currently 5, see <resolv.h>).
The drawback is that it is a system wide setting that (AFAIK) can not be changed for specific applications.
update: hey!, actually it can be changed in a per process manner...
The options keyword of a system's resolv.conf file can be amended on a per-process basis by setting the environment variable "RES_OPTIONS" to a space-separated list of resolver options as explained above under options.So, probably doing...
before calling gethostbyname will do what you want!$ENV{RES_OPTIONS} = "timeout:$timeout";
In reply to Re: Timout a gethostbyaddr?
by salva
in thread Timout a gethostbyaddr?
by rementis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |