servicediscoveryandcontrol/pnp/test/upnp/unittests/tcpserver/inc/ctcpservertestupnp9.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 
       
    20 #ifndef CTCPSERVERTESTUPNP9_H_
       
    21 #define CTCPSERVERTESTUPNP9_H_
       
    22 
       
    23 //----------------------------------------------------------//
       
    24 /////////////////// CTcpServerTestUPnP9 /////////////////////////
       
    25 //////Testcase: Send the test data from the test client/////////
       
    26 //----------------------------------------------------------//
       
    27 
       
    28 
       
    29 NONSHARABLE_CLASS(CTcpServerTestUPnP9) : public CTcpServerTestBase,
       
    30 										public Messages::ASimpleNodeIdBase,
       
    31 										public MSocketHandlerObserver										
       
    32 	{
       
    33 public:
       
    34 	static CTcpServerTestUPnP9* NewL ( CProxyProvd* aProvd );
       
    35 	~CTcpServerTestUPnP9 ();
       
    36 	
       
    37 	void ReceivedL ( const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage );
       
    38 	
       
    39 	// From MSocketHandlerObserver
       
    40 	void OpenComplete ( RInternalSocket& aSocket );
       
    41 	void ConnectComplete ();
       
    42 	void AcceptComplete ( RInternalSocket& /*aSocket*/ ) 
       
    43 	{	}
       
    44 	void SendComplete ( TInt aLength );	
       
    45 	void SendToComplete ( TInt /*aLength*/ )
       
    46 	{	}
       
    47 	void RecvComplete ( RMBufChain& aData );
       
    48 	void RecvFromComplete ( RMBufChain& /*aData*/, const TSockAddr& /*aAddr*/ )
       
    49 	{	}
       
    50 	void IoctlComplete ()
       
    51 	{	}
       
    52 	void Error ( TOperation /*aOperation*/, TInt /*aError*/ )
       
    53 	{	}
       
    54 	
       
    55 private:
       
    56 	enum TState
       
    57 		{
       
    58 		ECreateServer = 0,
       
    59 		EStartServer,
       
    60 		EOpenClientSocketAndConnect,
       
    61 		ESendData,
       
    62 		ESendStopServer,
       
    63 		EServerStopped,		
       
    64 		ECleanup,
       
    65 		};
       
    66 		
       
    67 	CTcpServerTestUPnP9 ( CProxyProvd* aProvd );
       
    68 	void ConstructL ();
       
    69 	virtual TVerdict RunTestL ();
       
    70 	
       
    71 private:	
       
    72 	Messages::TNodeId 	iTcpServer;
       
    73 	RBuf8				iServiceUri;
       
    74 	
       
    75 	RInternalSocket		iClientSocket;
       
    76 	RSocketHandler		iSocketHandler;
       
    77 	CSocketOpener*		iSocketOpener;
       
    78 	
       
    79 	RMBufChain			iSendChain;
       
    80 	TInetAddr			iHostAddr;
       
    81 	TVerdict			iResponse;
       
    82 	
       
    83 	RTimer				iTimer;
       
    84 	TState				iState;
       
    85 	};
       
    86 
       
    87 
       
    88 #endif /*CTCPSERVERTESTUPNP9_H_*/