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

# 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
    00122         OSCL_IMPORT_REF TPVDNSEvent GetHostByName(char *name, OsclNetworkAddress& addr,
    00123                 int32 aTimeoutMsec = -1, Oscl_Vector<OsclNetworkAddress, OsclMemAllocator>* aAddressList = NULL);
    00124
    00133         OSCL_IMPORT_REF void CancelGetHostByName();
    00134
    00135     private:
    00136         OsclDNS(
    00137             Oscl_DefAlloc &alloc,
    00138             OsclDNSObserver& obs,
    00139             uint32 id);
    00140         void ConstructL(OsclSocketServ &aServ);
    00141
    00142         OsclGetHostByNameMethod* iGetHostByNameMethod;
    00143         Oscl_DefAlloc& iAlloc;
    00144         OsclDNSObserver& iObserver;
    00145         uint32 iId;
    00146         OsclDNSI *iDNS;
    00147         friend class OsclDNSRequestAO;
    00148
    00149 };
    00150
    00151
    00152
    00153 #endif
    00154