00001 /* 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 * 00005 * DNS name resolver with support for background lookups. 00006 */ 00007 #ifndef __WVRESOLVER_H 00008 #define __WVRESOLVER_H 00009 00010 #include "wvaddr.h" 00011 #include "wvstream.h" 00012 #include "wvlinklist.h" 00013 00014 class WvResolverHostDict; 00015 class WvResolverAddrDict; 00016 00017 DeclareWvList(WvIPAddr); 00018 00022 class WvResolver 00023 { 00024 static int numresolvers; 00025 static WvResolverHostDict *hostmap; 00026 static WvResolverAddrDict *addrmap; 00027 public: 00028 WvResolver(); 00029 ~WvResolver(); 00030 00036 int findaddr(int msec_timeout, const WvString &name, 00037 WvIPAddr const **addr, WvIPAddrList *addrlist = 0); 00038 int findname(int msec_timeout, WvIPAddr *ipaddr, char **name); 00039 00040 void clearhost(const WvString &hostname); 00041 00045 bool pre_select(const WvString &hostname, WvStream::SelectInfo &si); 00046 }; 00047 00048 #endif // __WVRESOLVER_H