servicediscoveryandcontrol/pnp/test/upnp/Server/AppProtIntf/inc/app_protintf_tcp.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 //
       
    15 
       
    16 #ifndef __APP_PROTINTF_TCP_H__
       
    17 #define __APP_PROTINTF_TCP_H__
       
    18 
       
    19 #include <in_sock.h>
       
    20 #include <es_mbuf.h>
       
    21 #include "app_protintf_base.h"
       
    22 
       
    23 class RMBufChain;
       
    24 
       
    25 class CApplicationProtocolIntfTcp : public CApplicationProtocolIntfBase
       
    26 	{
       
    27 	public:
       
    28 	static CApplicationProtocolIntfBase* NewL ( TInt aPort );
       
    29 	inline virtual TUint Protocol () const;
       
    30 	~CApplicationProtocolIntfTcp ();
       
    31 	
       
    32 	protected:
       
    33 	virtual void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
    34 	
       
    35 	private:
       
    36 	CApplicationProtocolIntfTcp ( TInt aPort );
       
    37 	virtual TInt Startup ();
       
    38 	virtual void Shutdown ();
       
    39 	
       
    40 	void DoAccept ();	
       
    41 
       
    42 	virtual void AcceptComplete ( RInternalSocket& aSocket );
       
    43 	virtual void RecvComplete ( RMBufChain& aData );
       
    44 	virtual void SendComplete ( TInt aLength );
       
    45 	virtual void Error ( TOperation aOperation, TInt aError );
       
    46 	private:
       
    47 	
       
    48 	RInternalSocket iAcceptedSocket;
       
    49 	RSocketHandler	iAcceptedSocketHandler;	
       
    50 	RMBufChain 		iReceivedData;
       
    51 	};
       
    52 	
       
    53 TUint CApplicationProtocolIntfTcp::Protocol () const
       
    54 	{
       
    55 	return KProtocolInetTcp;
       
    56 	}
       
    57 	
       
    58 #endif // __APP_PROTINTF_TCP_H__