tcpiputils/dnd/Test/te_dnssuffix/inc/DNSSuffixHostResolver.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:33:58 +0100
branchRCL_3
changeset 58 8d540f55e491
parent 53 7e41d162e158
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201035 Kit: 201035

// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// 
 

#ifndef DNSSUFFIXHOSTRESOLVER_H
#define DNSSUFFIXHOSTRESOLVER_H

#include <e32base.h>	
#include <e32std.h>		
#include <es_sock.h>

#include "CallBackHandler.h"

// Forwared declarations


class CDNSSuffixHostResolver : public CActive
    {
public:
    // Cancel and destroy
    ~CDNSSuffixHostResolver();

    // Two-phased constructor.
    static CDNSSuffixHostResolver* NewL(MCallBackHandler& aCallback,RSocketServ& aSockServ,RConnection& aConn);

    // Two-phased constructor.
    static CDNSSuffixHostResolver* NewLC(MCallBackHandler& aCallback,RSocketServ& aSockServ,RConnection& aConn);

public:
    // New functions
    // Function for making the initial request
    TInt ResolveL(const TDesC& aHostName);

private:
    // C++ constructor
    CDNSSuffixHostResolver(MCallBackHandler& aCallback,RSocketServ& aSockServ,RConnection& aConn);

    // Second-phase constructor
    void ConstructL();

private:
    // From CActive
    // Handle completion
    void RunL();

    // How to cancel me
    void DoCancel();

    // Override to handle leaves from RunL(). Default implementation causes
    // the active scheduler to panic.
    TInt RunError(TInt aError);

private:
    MCallBackHandler&   iCallBack;
    RSocketServ&    iSockServ;
    RConnection&    iConn;
    RHostResolver   iResolver;
    TNameEntry      iEntry;
    };

#endif // DNSSUFFIXHOSTRESOLVER_H