plugins/networking/winsockprt/inc/wsp_session.h
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // wsp_session.h
       
     2 // 
       
     3 // Copyright (c) 2002 - 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "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 // Accenture - Initial contribution
       
    11 //
       
    12 
       
    13 #ifndef __WSP_SESSION_H__
       
    14 #define __WSP_SESSION_H__
       
    15 
       
    16 #include "wsp_request.h"
       
    17 #include "wsp_scheduler.h"
       
    18 
       
    19 class CWin32SubSession;
       
    20 
       
    21 class RWin32Session
       
    22 	{
       
    23 public:
       
    24 	TInt Open();
       
    25 protected:
       
    26 	void Close();
       
    27 	TInt MakeRequest(TWin32Message& aMessage);
       
    28 private:
       
    29 	TInt CreateThread();
       
    30 private:
       
    31 	friend class RWin32SubSession;
       
    32 	RThread iThread;
       
    33 	TWin32Request iRequest;
       
    34 	TWin32Message iWin32Message;
       
    35 	};
       
    36 
       
    37 
       
    38 class CWin32Session : public CWin32ActiveObject
       
    39 	{
       
    40 public:
       
    41 	enum
       
    42 		{
       
    43 		EClose = 0,
       
    44 		ECloseSubSession
       
    45 		};
       
    46 public:
       
    47 	void AddSubSessionL(CWin32SubSession* aSubSession);
       
    48 protected:
       
    49 	virtual void ServiceL(TWin32Message& aMessage) = 0;
       
    50 protected:
       
    51 	~CWin32Session();
       
    52 	CWin32Session(TWin32Request& aRequest, CWin32Scheduler& aScheduler);
       
    53 	void ConstructL();
       
    54 protected: // From CWin32ActiveObject.
       
    55 	virtual void Run();
       
    56 private:
       
    57 	void Close();
       
    58 	void CloseSubSession();
       
    59 private:
       
    60 	TWin32Request& iRequest;
       
    61 	RPointerArray<CWin32SubSession> iSubSessions;
       
    62 	};
       
    63 
       
    64 
       
    65 GLDEF_C TInt WinSockPrtThreadStart(TAny* aPtr);
       
    66 GLDEF_C void InitialiseAndRunThreadL(TAny* aPtr);
       
    67 
       
    68 #endif // __WSP_SESSION_H__