applayerprotocols/httpservice/test/httpservicetest/clocaltestserver.h
changeset 0 b16258d2340f
child 18 5f1cd966e0d9
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 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 __CLOCALTESTSERVER_H__
       
    17 #define __CLOCALTESTSERVER_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <mconnectionprefsprovider.h>
       
    21 #include <msocketlistenobserver.h>
       
    22 
       
    23   
       
    24 class CHttpTransportLayer;
       
    25 class MInputStream;
       
    26 class MOutputStream;
       
    27 class CHTTPTestUtils;
       
    28 class MLocalTestServerObserver;
       
    29 class CLocalTestServerStreamManager;
       
    30 class CHttpClientTestParamArray;
       
    31 
       
    32 
       
    33 class CLocalTestServer : public CBase,
       
    34 							  public MConnectionPrefsProvider,
       
    35 							  public MSocketListenObserver
       
    36 	{
       
    37 public:
       
    38 	static CLocalTestServer* NewL(CHTTPTestUtils& aTestUtils, MLocalTestServerObserver& aObserver, CHttpClientTestParamArray& aTestParamArray);
       
    39 	~CLocalTestServer();
       
    40 
       
    41 	void StartServerL();
       
    42 	void StopServer();
       
    43 	void ResetServer();
       
    44 	
       
    45 private:
       
    46 	CLocalTestServer(CHTTPTestUtils& aTestUtils, MLocalTestServerObserver& aObserver, CHttpClientTestParamArray& aTestParamArray);
       
    47 	void ConstructL();
       
    48 	
       
    49 	// From MSocketListenObserver
       
    50 	void ConnectionReceivedL(MInputStream& aInputStream, MOutputStream& aOutputStream);
       
    51 	TInt HandleListenError(TInt aError);
       
    52 	void MSocketListenObserver_Reserved();
       
    53 	
       
    54 	// From MConnectionPrefsProvider
       
    55 	TBool SupplyCommsConnection(RConnection*& aConnectionPtr);
       
    56  	void SetCommsConnectionL(RConnection* aConnectionPtr);
       
    57 	void GetSecurityPrefs(TBool& aDialogPrompt, MSecurityPolicy*& aSecurityPolicy);
       
    58 	TBool ImmediateSocketShutdown();
       
    59 	virtual TBool SupplySocketServerHandle ( TInt& aSocketServerHandle );
       
    60   	virtual void SetSocketServerHandleL ( TInt aSocketServerHandle );
       
    61 	TInt SessionId();
       
    62 	TInt GetRecvBufferSize();
       
    63 
       
    64 private:
       
    65 	CHTTPTestUtils& 					iTestUtils;
       
    66 	MLocalTestServerObserver&	iObserver;
       
    67 	CHttpTransportLayer*			iTCPLayer;
       
    68 	RPointerArray<CLocalTestServerStreamManager> iStreamManagers;
       
    69 	CHttpClientTestParamArray&         iTestParamArray;	
       
    70 	};
       
    71 	
       
    72 #endif // __CLOCALTESTSERVER_H__
       
    73