servicediscoveryandcontrol/pnp/test/upnp/Server/ControlPoint/inc/upnpmcpr.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 __UPNPMCPR_H
       
    20 #define __UPNPMCPR_H
       
    21 
       
    22 #include <comms-infras/coremcpr.h>
       
    23 #include <rsockethandler.h>
       
    24 #include <csocketopener.h>
       
    25 #include <in_sock.h>
       
    26 #include <cchunkmanager.h>
       
    27 
       
    28 class CUPnPMetaConnectionProvider : public CCoreMetaConnectionProvider,
       
    29 								public MSocketHandlerObserver
       
    30 	{
       
    31 public:
       
    32 	static CUPnPMetaConnectionProvider* NewL (
       
    33 		ESock::CMetaConnectionProviderFactoryBase& aFactory, 
       
    34 		const ESock::TProviderInfo& aProviderInfo );
       
    35 	virtual ~CUPnPMetaConnectionProvider ();
       
    36 		
       
    37 	const TDesC8& DeviceLocationUrl ();	
       
    38 	CChunkManager* ChunkManager();
       
    39 private:
       
    40 	CUPnPMetaConnectionProvider (
       
    41 		ESock::CMetaConnectionProviderFactoryBase& aFactory, 
       
    42 		const ESock::TProviderInfo& aProviderInfo, 
       
    43 		const MeshMachine::TNodeActivityMap& aActivityMap );
       
    44 	void ConstructL ();
       
    45 
       
    46 private:
       
    47     virtual void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );    
       
    48 	void FindLocalHost ();
       
    49 	TInt GenerateDeviceLocation ( const TInetAddr& aAddr );
       
    50 	
       
    51 	//From MSocketHandlerObserver
       
    52 	void OpenComplete ( RInternalSocket& aSocket );
       
    53 	inline void ConnectComplete ();
       
    54 	inline void AcceptComplete ( RInternalSocket& aSocket );
       
    55 	inline void SendComplete ( TInt aLength );
       
    56 	inline void SendToComplete ( TInt aLength );
       
    57 	inline void RecvComplete ( RMBufChain& aData );
       
    58 	inline void RecvFromComplete ( RMBufChain& aData, const TSockAddr& aAddr );
       
    59 	void Error ( TOperation aOperation, TInt aError  );
       
    60 	
       
    61 private:
       
    62 	CSocketOpener*	iSocketOpener;
       
    63 	RInternalSocket iSocket;
       
    64 	RBuf8			iDeviceLocation;
       
    65 	CChunkManager*  iChunkManager;
       
    66 	};
       
    67 
       
    68 
       
    69 void CUPnPMetaConnectionProvider::ConnectComplete ()
       
    70 	{ }
       
    71 	
       
    72 void CUPnPMetaConnectionProvider::AcceptComplete ( RInternalSocket& /*aSocket*/ )
       
    73 	{ }
       
    74 
       
    75 void CUPnPMetaConnectionProvider::SendComplete ( TInt /*aLength*/ )
       
    76 	{ }
       
    77 	
       
    78 void CUPnPMetaConnectionProvider::SendToComplete ( TInt /*aLength*/ )
       
    79 	{ }
       
    80 
       
    81 void CUPnPMetaConnectionProvider::RecvComplete ( RMBufChain& /*aData*/ )
       
    82 	{ }
       
    83 	
       
    84 void CUPnPMetaConnectionProvider::RecvFromComplete ( RMBufChain& /*aData*/, const TSockAddr& /*aAddr*/ )
       
    85 	{ }
       
    86 #endif // UPNPMCPR_H