applayerprotocols/httptransportfw/Test/t_httptransporthandler/cserversocketdriver.h
changeset 0 b16258d2340f
equal deleted inserted replaced
-1:000000000000 0:b16258d2340f
       
     1 // Copyright (c) 2002-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 __CSERVERSOCKETDRIVER_H__
       
    17 #define __CSERVERSOCKETDRIVER_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 #include "csocketdriver.h"
       
    22 #include "msocketdriverobserver.h"
       
    23 
       
    24 class MInputStream;
       
    25 class MOutputStream;
       
    26 class MServerDriverObserver;
       
    27 
       
    28 /**	@class		CServerSocketDriver
       
    29 	The CServerSocketDriver class is a specilisation of the CSocketDriver class.
       
    30 	Its behaviour is that of a server - it expects receive some data, i.e. a 
       
    31 	request, and then it sends some data, i.e. the response. After it has sent 
       
    32 	the data it expects the connection to be closed.
       
    33 	@componentInternal		
       
    34 	@see		CSocketDriver
       
    35 */
       
    36 class CServerSocketDriver : public CSocketDriver,
       
    37 							public MSocketDriverObserver
       
    38 	{
       
    39 public:	// methods
       
    40 
       
    41 	static CServerSocketDriver* NewL(
       
    42 									MDriverObserver&		aDriverObserver,
       
    43 									MServerDriverObserver&	aObserver, 
       
    44 									MInputStream&			aInputStream, 
       
    45 									MOutputStream&			aOutputStream
       
    46 									);
       
    47 
       
    48 	virtual ~CServerSocketDriver();
       
    49 
       
    50 private:	// methods from CSocketDriver
       
    51 
       
    52 	virtual void SetCmdsL();
       
    53 
       
    54 	virtual const TDesC8& SendData();
       
    55 
       
    56 	virtual const TDesC8& ReceiveData();
       
    57 
       
    58 private:	// methods from MSocketDriverObserver
       
    59 
       
    60 	virtual void SocketClosed();
       
    61 
       
    62 private:	// methods
       
    63 
       
    64 	CServerSocketDriver(MDriverObserver& aDriverObserver, MServerDriverObserver& aObserver); 
       
    65 
       
    66 private:	// attributes
       
    67 
       
    68 /**	The server socket driver observer.
       
    69 */
       
    70 	MServerDriverObserver&	iObserver;
       
    71 
       
    72 	};
       
    73 
       
    74 #endif	// __CSERVERSOCKETDRIVER_H__