servicediscoveryandcontrol/pnp/test/upnp/unittests/tcpserver/inc/ctcpservertestupnp7.h
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CTCPSERVERTESTUPNP7_H_
       
    20 #define CTCPSERVERTESTUPNP7_H_
       
    21 
       
    22 //----------------------------------------------------------//
       
    23 /////////////////// CTcpServerTestUPnP7 /////////////////////////
       
    24 //////Testcase: Send the test data from the test client/////////
       
    25 //----------------------------------------------------------//
       
    26 
       
    27 
       
    28 NONSHARABLE_CLASS(CTcpServerTestUPnP7) : public CTcpServerTestBase,
       
    29 										public Messages::ASimpleNodeIdBase,
       
    30 										public MSocketHandlerObserver										
       
    31 	{
       
    32 public:
       
    33 	static CTcpServerTestUPnP7* NewL ( CProxyProvd* aProvd );
       
    34 	~CTcpServerTestUPnP7 ();
       
    35 	
       
    36 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
    37 	
       
    38 	// From MSocketHandlerObserver
       
    39 	void OpenComplete ( RInternalSocket& aSocket );
       
    40 	void ConnectComplete ();
       
    41 	void AcceptComplete ( RInternalSocket& /*aSocket*/ ) 
       
    42 	{	}
       
    43 	void SendComplete ( TInt aLength );	
       
    44 	void SendToComplete ( TInt /*aLength*/ )
       
    45 	{	}
       
    46 	void RecvComplete ( RMBufChain& aData );
       
    47 	void RecvFromComplete ( RMBufChain& /*aData*/, const TSockAddr& /*aAddr*/ )
       
    48 	{	}
       
    49 	void IoctlComplete ()
       
    50 	{	}
       
    51 	void Error ( TOperation /*aOperation*/, TInt /*aError*/ )
       
    52 	{	}
       
    53 	
       
    54 private:
       
    55 	enum TState
       
    56 		{
       
    57 		ECreateServer = 0,
       
    58 		EStartServer,
       
    59 		EOpenClientSocketAndConnect,
       
    60 		ESendData,
       
    61 		ESendStopServer,
       
    62 		EServerStopped,		
       
    63 		ECleanup,
       
    64 		};
       
    65 		
       
    66 	CTcpServerTestUPnP7 ( CProxyProvd* aProvd );
       
    67 	void ConstructL ();
       
    68 	virtual TVerdict RunTestL ();
       
    69 	
       
    70 private:	
       
    71 	Messages::TNodeId 	iTcpServer;
       
    72 	RBuf8				iServiceUri;
       
    73 	
       
    74 	RInternalSocket		iClientSocket;
       
    75 	RSocketHandler		iSocketHandler;
       
    76 	CSocketOpener*		iSocketOpener;
       
    77 	
       
    78 	RMBufChain			iSendChain;
       
    79 	TInetAddr			iHostAddr;
       
    80 	TVerdict			iResponse;
       
    81 	
       
    82 	RTimer				iTimer;
       
    83 	TState				iState;
       
    84 	};
       
    85 
       
    86 
       
    87 #endif /*CTCPSERVERTESTUPNP7_H_*/