Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

wvresolver.h

Go to the documentation of this file.
00001 /* -*- Mode: C++ -*- 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 #include "wvhashtable.h" 00014 00015 class WvResolverHost; 00016 class WvResolverAddr; 00017 00018 DeclareWvDict(WvResolverHost, WvString, name); 00019 DeclareWvDict(WvResolverAddr, WvIPAddr, addr[0]); 00020 00021 DeclareWvList(WvIPAddr); 00022 00023 /** ASynchronous DNS resolver functions, so that we can do non-blocking lookups */ 00024 class WvResolver 00025 { 00026 static int numresolvers; 00027 static WvResolverHostDict *hostmap; 00028 static WvResolverAddrDict *addrmap; 00029 public: 00030 WvResolver(); 00031 ~WvResolver(); 00032 00033 /** 00034 * Return -1 on timeout, or the number of addresses found, which may 00035 * be 0 if the address does not exist. 00036 * addrlist, if present, has to be an initialized list. 00037 * addr points to an internal WvIPAddr and will be deleted automatically. 00038 */ 00039 int findaddr(int msec_timeout, WvStringParm name, 00040 WvIPAddr const **addr, WvIPAddrList *addrlist = NULL); 00041 int findname(int msec_timeout, WvIPAddr *ipaddr, char **name); 00042 00043 void clearhost(WvStringParm hostname); 00044 00045 /** add all of our waiting fds to an fd_set for use with select(). */ 00046 bool pre_select(WvStringParm hostname, WvStream::SelectInfo &si); 00047 }; 00048 00049 #endif // __WVRESOLVER_H

Generated on Tue Oct 5 01:09:20 2004 for WvStreams by doxygen 1.3.7