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