tcpiputils/dnd/Test/te_dnssuffix/inc/DNSSuffixHostResolver.h
branchRCL_3
changeset 58 8d540f55e491
parent 53 7e41d162e158
equal deleted inserted replaced
57:abbed5a4b42a 58:8d540f55e491
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // 
       
    15  
       
    16 
       
    17 #ifndef DNSSUFFIXHOSTRESOLVER_H
       
    18 #define DNSSUFFIXHOSTRESOLVER_H
       
    19 
       
    20 #include <e32base.h>	
       
    21 #include <e32std.h>		
       
    22 #include <es_sock.h>
       
    23 
       
    24 #include "CallBackHandler.h"
       
    25 
       
    26 // Forwared declarations
       
    27 
       
    28 
       
    29 class CDNSSuffixHostResolver : public CActive
       
    30     {
       
    31 public:
       
    32     // Cancel and destroy
       
    33     ~CDNSSuffixHostResolver();
       
    34 
       
    35     // Two-phased constructor.
       
    36     static CDNSSuffixHostResolver* NewL(MCallBackHandler& aCallback,RSocketServ& aSockServ,RConnection& aConn);
       
    37 
       
    38     // Two-phased constructor.
       
    39     static CDNSSuffixHostResolver* NewLC(MCallBackHandler& aCallback,RSocketServ& aSockServ,RConnection& aConn);
       
    40 
       
    41 public:
       
    42     // New functions
       
    43     // Function for making the initial request
       
    44     TInt ResolveL(const TDesC& aHostName);
       
    45 
       
    46 private:
       
    47     // C++ constructor
       
    48     CDNSSuffixHostResolver(MCallBackHandler& aCallback,RSocketServ& aSockServ,RConnection& aConn);
       
    49 
       
    50     // Second-phase constructor
       
    51     void ConstructL();
       
    52 
       
    53 private:
       
    54     // From CActive
       
    55     // Handle completion
       
    56     void RunL();
       
    57 
       
    58     // How to cancel me
       
    59     void DoCancel();
       
    60 
       
    61     // Override to handle leaves from RunL(). Default implementation causes
       
    62     // the active scheduler to panic.
       
    63     TInt RunError(TInt aError);
       
    64 
       
    65 private:
       
    66     MCallBackHandler&   iCallBack;
       
    67     RSocketServ&    iSockServ;
       
    68     RConnection&    iConn;
       
    69     RHostResolver   iResolver;
       
    70     TNameEntry      iEntry;
       
    71     };
       
    72 
       
    73 #endif // DNSSUFFIXHOSTRESOLVER_H