hti/HtiServicePlugins/HtiIpProxyServicePlugin/IPProxyEngine/Src/MSocketRouterTestObserver.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 16:17:58 +0300
branchRCL_3
changeset 59 8ad140f3dd41
parent 0 a03f92240627
permissions -rw-r--r--
Revision: 201039 Kit: 201041

/*
* 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:  Observer for socket router for test purposes.
*                This is currently the only way to get the parsed frame back to
*                the unit test class.
*
*/



#ifndef MSOCKETROUTERTESTOBSERVER_H
#define MSOCKETROUTERTESTOBSERVER_H

//  INCLUDES
#include <e32def.h>


// FORWARD DECLARATIONS
class CSocket;

// CLASS DECLARATION

/**
*  Observer for socket router.
*/
NONSHARABLE_CLASS( MSocketRouterTestObserver )
    {
    public: // Abstract functions

        /**
        * Starting point of a frame has been found.
        */
        virtual void FrameStarted() = 0;

        /**
        * Forwards the parsed frame info to the observer
        */
        virtual void FrameParsedL(
            TUint aPort,
            const TDesC8& aData ) = 0;

        /**
        * Error occurred when parsing data.
        * @param aErrorCode Error code.
        * @param aReceivedData Whole frame that failed to be parsed.
        */
        virtual void ProtocolErrorL(
            TInt aErrorCode,
            const TDesC8& aReceivedData ) = 0;

        /**
        * Open a TCP connection to phone side port
        * @param aPort Port number where to connect
        */
        virtual void OpenLocalTCPConnectionL( TUint aPort ) = 0;

        /**
        * Close a TCP connection to phone side port
        * @param aPort Port number to close
        */
        virtual void CloseTCPConnection( TUint aPort ) = 0;

    };

#endif      // MSOCKETROUTERTESTOBSERVER_H

// End of File