res_close()--Close Socket and Reset _res Structure
Syntax
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> void res_close(void)
Service Program Name: QSOSRV2
Default Public Authority: *USE
Threadsafe: Yes
The res_close() function is used to reset the _res structure to the beginning defaults and close a socket that is opened as a result of the RES_STAYOPEN flag.
Authorities:
No authorization is required.
Return Value
None.
Usage Notes
- If res_send() was previously called with RES_STAYOPEN set in the
options field of the _res structure, res_close()
closes the socket that was left open. res_close() does not attempt the
close if there was no socket left open.
- res_close() sets the _res structure to default
values.
- The retrans field is set to 5.
- The retry field is set to 4.
- The options field has the RES_RECURSE, RES_DEFDNAMES, and RES_DNSSRCH bits set.
- The nscount field is set to 1.
- All other fields in the _res structure are cleared.
- In a thread-enabled environment _res structure is shared among all threads within a process.
Related Information
- res_nclose()--Close Socket and Reset res
Structure
- res_hostalias()--Retrieve the host alias
- res_init()--Initialize _res Structure
- res_mkquery()--Place Domain Query in Buffer
- res_query()--Send Domain Query
- res_search()--Search for Domain Name
- res_send()--Send Buffered Domain Query
- res_xlate()--Translate DNS Packets
API introduced: V3R1