|
1 // Copyright (c) 2003-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 __CPIPELININGTESTSERVER_H__ |
|
17 #define __CPIPELININGTESTSERVER_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <mconnectionprefsprovider.h> |
|
21 #include <msocketlistenobserver.h> |
|
22 |
|
23 class CHttpTransportLayer; |
|
24 class MInputStream; |
|
25 class MOutputStream; |
|
26 class CHTTPTestUtils; |
|
27 class MPipeliningTestCase; |
|
28 class MPipeliningTestObserver; |
|
29 class CTestServerStreamManager; |
|
30 |
|
31 const TInt KDefaultBufferSize = 6*1024; |
|
32 |
|
33 class CPipeliningTestServer : public CBase, |
|
34 public MConnectionPrefsProvider, |
|
35 public MSocketListenObserver |
|
36 { |
|
37 public: |
|
38 static CPipeliningTestServer* NewL(CHTTPTestUtils& aTestUtils, MPipeliningTestObserver& aObserver); |
|
39 ~CPipeliningTestServer(); |
|
40 |
|
41 void StartServerL(); |
|
42 void StopServer(); |
|
43 void ResetServer(); |
|
44 void SetTestCase(MPipeliningTestCase* aTestCase); |
|
45 TInt ConnectionCount() const; |
|
46 |
|
47 private: |
|
48 CPipeliningTestServer(CHTTPTestUtils& aTestUtils, MPipeliningTestObserver& aObserver); |
|
49 void ConstructL(); |
|
50 |
|
51 // From MSocketListenObserver |
|
52 void ConnectionReceivedL(MInputStream& aInputStream, MOutputStream& aOutputStream); |
|
53 TInt HandleListenError(TInt aError); |
|
54 void MSocketListenObserver_Reserved(); |
|
55 |
|
56 // From MConnectionPrefsProvider |
|
57 TBool SupplyCommsConnection(RConnection*& aConnectionPtr); |
|
58 void SetCommsConnectionL(RConnection* aConnectionPtr); |
|
59 void GetSecurityPrefs(TBool& aDialogPrompt, MSecurityPolicy*& aSecurityPolicy); |
|
60 TBool ImmediateSocketShutdown(); |
|
61 TInt SessionId(); |
|
62 virtual TBool SupplySocketServerHandle ( TInt& aSocketServerHandle ); |
|
63 virtual void SetSocketServerHandleL ( TInt aSocketServerHandle ); |
|
64 TInt GetRecvBufferSize(); |
|
65 |
|
66 private: |
|
67 CHTTPTestUtils& iTestUtils; |
|
68 MPipeliningTestObserver& iObserver; |
|
69 CHttpTransportLayer* iTCPLayer; |
|
70 MPipeliningTestCase* iTestCase; // Not owned |
|
71 RPointerArray<CTestServerStreamManager> iStreamManager; |
|
72 }; |
|
73 |
|
74 #endif // __CPIPELININGTESTSERVER_H__ |
|
75 |