servicediscoveryandcontrol/pnp/test/upnp/Server/Flow/inc/cprotocolhandler.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 // Copyright (c) 2008-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 // @file
       
    15 // @internalComponent
       
    16 // 
       
    17 //
       
    18 
       
    19 #ifndef __CPROTOCOLHANDLER_H_
       
    20 #define __CPROTOCOLHANDLER_H_
       
    21 
       
    22 
       
    23 // System Includes
       
    24 #include "httpevent.h"
       
    25 
       
    26 // Local Includes
       
    27 #include "ctransaction.h"
       
    28 #include "rsockethandler.h"
       
    29 #include "mcomposerobserver.h"
       
    30 #include "mparserobserver.h"
       
    31 #include "cupnptimer.h"
       
    32 
       
    33 class MHttpEventObserver
       
    34 	{
       
    35 public:
       
    36 	virtual TInt OnHttpEvent ( CTransaction* aTransaction, THTTPEvent& aEvent ) = 0;
       
    37 	};
       
    38  	
       
    39  	
       
    40 class CProtocolHandler : public CBase,						 
       
    41 						 public MSocketHandlerObserver,
       
    42 						 public MComposerObserver,
       
    43 						 public MParserObserver,
       
    44 						 public MHTTPDataSupplier,										
       
    45 						 public MUPnPTimerObserver
       
    46 	{
       
    47 public:
       
    48 	virtual ~CProtocolHandler ( );
       
    49 	
       
    50 protected:
       
    51 	CProtocolHandler ( RInternalSocket& aSocket );
       
    52 	CProtocolHandler ( );	
       
    53 	void ConstructL ();
       
    54 	
       
    55 	TInt FindTransaction ( CTransaction* aTransaction ) const;
       
    56 	TInt FindTransaction ( const CRequest* aRequest ) const;
       
    57 	
       
    58 	// From MSocketHandlerObserver
       
    59 	inline void AcceptComplete ( RInternalSocket& /*aSocket*/ );
       
    60 	inline void SendToComplete ( TInt /*aLength*/ );
       
    61 	inline void RecvFromComplete ( RMBufChain& /*aData*/, const TSockAddr& /*aAddr*/ );
       
    62 	
       
    63 	// From MHTTPDataSupplier
       
    64 	inline TInt Reset ();
       
    65 	
       
    66 protected:
       
    67 	RSocketHandler 			iSocketHandler;
       
    68 	RInternalSocket 		iSocket;	
       
    69 	RArray<CTransaction*>	iTransactions;	
       
    70 	CUPnPTimer*				iTimer;
       
    71 	};
       
    72 
       
    73 
       
    74 void CProtocolHandler::AcceptComplete ( RInternalSocket& /*aSocket*/ )
       
    75 	{
       
    76 	}
       
    77 
       
    78 void CProtocolHandler::SendToComplete ( TInt /*aLength*/ )
       
    79 	{
       
    80 	}
       
    81 
       
    82 void CProtocolHandler::RecvFromComplete ( RMBufChain& /*aData*/, const TSockAddr& /*aAddr*/ )
       
    83 	{
       
    84 	}
       
    85 
       
    86 TInt CProtocolHandler::Reset ()
       
    87 	{
       
    88 	return KErrNone;
       
    89 	}
       
    90 
       
    91 
       
    92 #endif // CPROTOCOLHANDLER_H