|
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 CTCPSERVERTESTUPNP12_H_ |
|
20 #define CTCPSERVERTESTUPNP12_H_ |
|
21 |
|
22 //----------------------------------------------------------// |
|
23 /////////////////// CTcpServerTestUPnP12 ///////////////////////// |
|
24 //////Testcase: Send the test data from the test client///////// |
|
25 //----------------------------------------------------------// |
|
26 |
|
27 |
|
28 NONSHARABLE_CLASS(CTcpServerTestUPnP12) : public CTcpServerTestBase, |
|
29 public Messages::ASimpleNodeIdBase, |
|
30 public MSocketHandlerObserver |
|
31 { |
|
32 public: |
|
33 static CTcpServerTestUPnP12* NewL ( CProxyProvd* aProvd ); |
|
34 ~CTcpServerTestUPnP12 (); |
|
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 CTcpServerTestUPnP12 ( 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 /*CTCPSERVERTESTUPNP12_H_*/ |