Introduction of ares_library_init() and ares_library_cleanup()

This commit is contained in:
Yang Tse 2009-05-17 17:11:28 +00:00
parent 60a6af7498
commit 2d64cd55a1
9 changed files with 75 additions and 28 deletions

View file

@ -77,6 +77,13 @@ int main(int argc, char **argv)
WSAStartup(wVersionRequested, &wsaData);
#endif
status = ares_library_init(ARES_LIB_INIT_ALL);
if (status != ARES_SUCCESS)
{
fprintf(stderr, "ares_library_init: %s\n", ares_strerror(status));
return 1;
}
while ((c = ares_getopt(argc,argv,"dt:h")) != -1)
{
switch (c)
@ -147,6 +154,8 @@ int main(int argc, char **argv)
ares_destroy(channel);
ares_library_cleanup();
#ifdef USE_WINSOCK
WSACleanup();
#endif