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

# oscl_dns_gethostbyname.h

Go to the documentation of this file.

    00001
    00002 #ifndef OSCL_DNS_GETHOSTBYNAME_H_INCLUDED
    00003 #define OSCL_DNS_GETHOSTBYNAME_H_INCLUDED
    00004
    00005 //#include "oscl_socket_serv_imp.h"
    00006 #include "oscl_dns_method.h"
    00007 #include "oscl_dns.h"
    00008 #include "osclconfig_io.h"
    00009
    00010
    00011 class OsclGetHostByNameRequest;
    00012
    00013 class OsclGetHostByNameMethod : public OsclDNSMethod
    00014 {
    00015     public:
    00016         static OsclGetHostByNameMethod *NewL(Oscl_DefAlloc &a,
    00017                                              OsclDNSI *aDNS,
    00018                                              OsclDNSObserver *aObserver,
    00019                                              uint32 aId);
    00020
    00021         ~OsclGetHostByNameMethod();
    00022
    00023         TPVDNSEvent GetHostByName(char *name, OsclNetworkAddress *addr,
    00024                                   int32 aTimeout, Oscl_Vector<OsclNetworkAddress, OsclMemAllocator> * aAddressList);
    00025
    00026
    00027     private:
    00028         OsclGetHostByNameMethod(Oscl_DefAlloc &a)
    00029                 : OsclDNSMethod(a, "osclghbnmethod", EPVDNSGetHostByName)
    00030                 , iGetHostByNameRequest(NULL)
    00031         {}
    00032
    00033         void ConstructL(OsclDNSI* aDNS,
    00034                         OsclDNSObserver *aObserver,
    00035                         uint32 aId);
    00036
    00037         OsclGetHostByNameRequest *iGetHostByNameRequest;
    00038 };
    00039
    00040 class GetHostByNameParam;
    00041
    00042 class OsclGetHostByNameRequest : public OsclDNSRequestAO
    00043 {
    00044     private:
    00045         static OsclGetHostByNameRequest *NewL(
    00046             OsclDNSI *aDNS,
    00047             OsclGetHostByNameMethod *aMethod);
    00048
    00049         ~OsclGetHostByNameRequest();
    00050
    00051
    00052         OsclGetHostByNameRequest()
    00053                 : OsclDNSRequestAO("osclghbnrequest")
    00054                 , iParam(NULL)
    00055                 , iRequestPhase(GetFirstHostAddress)
    00056         {}
    00057
    00058         void ConstructL(OsclDNSI *aDNS,
    00059                         OsclGetHostByNameMethod *aMethod)
    00060         {
    00061             OsclDNSRequestAO::ConstructL(aDNS, aMethod);
    00062         }
    00063
    00064         virtual void Success();
    00065         virtual void Failure();
    00066         virtual void Cancelled();
    00067
    00068         void GetHostByName(char *name, OsclNetworkAddress *addr, Oscl_Vector<OsclNetworkAddress, OsclMemAllocator> *aAddressList);
    00069
    00070         GetHostByNameParam *iParam;
    00071         enum GetHostByNameRequestPhase
    00072         {
    00073             GetFirstHostAddress,
    00074             GetAlternateHostAddress
    00075         };
    00076
    00077         GetHostByNameRequestPhase iRequestPhase;
    00078         friend class OsclGetHostByNameMethod;
    00079
    00080 };
    00081
    00082
    00083
    00084 #endif
    00085