Main Page   Modules   Class Hierarchy   Data Structures   File List   Data Fields   Globals  

oscl_dns.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
00003 
00004 //                     O S C L _ D N S
00005 
00006 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
00007 
00018 #ifndef OSCL_DNS_H_INCLUDED
00019 #define OSCL_DNS_H_INCLUDED
00020 
00021 #ifndef OSCLCONFIG_IO_H_INCLUDED
00022 #include "osclconfig_io.h"
00023 #endif
00024 
00025 #ifndef OSCL_SOCKET_TYPES_H_INCLUDED
00026 #include "oscl_socket_types.h"
00027 #endif
00028 
00029 #ifndef OSCL_DEFALLOC_H_INCLUDED
00030 #include "oscl_defalloc.h"
00031 #endif
00032 
00033 #ifndef OSCL_SOCKET_H_INCLUDED
00034 #include "oscl_socket.h"
00035 #endif
00036 
00037 enum TPVDNSFxn
00038 {
00039     EPVDNSGetHostByName
00040 } ;
00041 
00042 enum TPVDNSEvent
00043 {
00044     EPVDNSSuccess
00045     , EPVDNSPending
00046     , EPVDNSTimeout
00047     , EPVDNSFailure
00048     , EPVDNSCancel
00049 } ;
00050 
00055 class OsclDNSObserver
00056 {
00057     public:
00069         OSCL_IMPORT_REF virtual void HandleDNSEvent(int32 aId, TPVDNSFxn aFxn, TPVDNSEvent aEvent, int32 aError) = 0;
00070 
00071         virtual ~OsclDNSObserver() {}
00072 };
00073 
00074 class OsclGetHostByNameMethod;
00075 class OsclDNSI;
00076 
00080 class OsclDNS: public HeapBase
00081 {
00082     public:
00093         OSCL_IMPORT_REF static OsclDNS* NewL(
00094             Oscl_DefAlloc &alloc,
00095             OsclSocketServ& aServ,
00096             OsclDNSObserver & aObserver,
00097             uint32 aId);
00098 
00106         OSCL_IMPORT_REF ~OsclDNS();
00107 
00121         OSCL_IMPORT_REF TPVDNSEvent GetHostByName(char *name, OsclNetworkAddress& addr,
00122                 int32 aTimeoutMsec = -1);
00123 
00132         OSCL_IMPORT_REF void CancelGetHostByName();
00133 
00134     private:
00135         OsclDNS(
00136             Oscl_DefAlloc &alloc,
00137             OsclDNSObserver& obs,
00138             uint32 id);
00139         void ConstructL(OsclSocketServ &aServ);
00140 
00141         OsclGetHostByNameMethod* iGetHostByNameMethod;
00142         Oscl_DefAlloc& iAlloc;
00143         OsclDNSObserver& iObserver;
00144         uint32 iId;
00145         OsclDNSI *iDNS;
00146         friend class OsclDNSRequestAO;
00147 
00148 };
00149 
00150 
00151 
00152 #endif
00153 

OSCL API
Posting Version: OPENCORE_20090310