|
1 /* |
|
2 * Copyright (c) 2009-2010 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 * Initial Contributors: |
|
9 * Nokia Corporation - initial contribution. |
|
10 * Contributors: |
|
11 * |
|
12 * Description: |
|
13 * MSRP Implementation |
|
14 * |
|
15 */ |
|
16 |
|
17 #ifndef CMSRPSERVERSESSION_H_ |
|
18 #define CMSRPSERVERSESSION_H_ |
|
19 |
|
20 #include "E32base.h" |
|
21 |
|
22 // Forward declarations |
|
23 class CMSRPServer; |
|
24 class RMessage2; |
|
25 class CMSRPServerSubSession; |
|
26 class MMSRPConnectionManager; |
|
27 |
|
28 |
|
29 // Class to handle multiple sub sessions |
|
30 |
|
31 class CMsrpHandleObj : public CBase |
|
32 { |
|
33 public: |
|
34 static CMsrpHandleObj* NewL( CMSRPServerSubSession* aSubSession); |
|
35 CMSRPServerSubSession* Subsession() const; |
|
36 TUint Handle() const; |
|
37 inline TBool Compare( TUint aHandle ) const; |
|
38 virtual ~CMsrpHandleObj(); |
|
39 |
|
40 private: |
|
41 void ConstructL(); |
|
42 CMsrpHandleObj( CMSRPServerSubSession* aSubSession); |
|
43 |
|
44 public: |
|
45 TSglQueLink iLink; |
|
46 |
|
47 private: |
|
48 CMSRPServerSubSession* iSubSession; |
|
49 TUint iHandle; |
|
50 }; |
|
51 |
|
52 |
|
53 |
|
54 class CMSRPServerSession : public CSession2 |
|
55 { |
|
56 public: |
|
57 static CMSRPServerSession* NewL( CMSRPServer& aServer ); |
|
58 static CMSRPServerSession* NewLC( CMSRPServer& aServer ); |
|
59 |
|
60 ~CMSRPServerSession(); |
|
61 void ServiceL( const RMessage2& aMessage ); |
|
62 MMSRPConnectionManager& ConnectionManager(); |
|
63 |
|
64 private: |
|
65 |
|
66 void ConstructL(); |
|
67 CMSRPServerSession( CMSRPServer& aServer ); |
|
68 |
|
69 void CreateSubSessionL( const RMessage2& aMessage ); |
|
70 void CloseSubSessionL( const RMessage2& aMessage ); |
|
71 void DispatchToSubSessionL( const RMessage2& aMessage ); |
|
72 |
|
73 // ITC Write functions. Must be moved out to a common location. |
|
74 void WriteResponseL( const RMessage2& aMessage, |
|
75 TServerClientResponses aResponseItem, |
|
76 TInt aValue ); |
|
77 |
|
78 CMsrpHandleObj* CMSRPServerSession::FindHandle( TInt aHandle ); |
|
79 |
|
80 private: |
|
81 CMSRPServer& iMSRPServer; |
|
82 TSglQue<CMsrpHandleObj> iSubSessionList; |
|
83 }; |
|
84 |
|
85 #endif /* CMSRPSERVERSESSION_H_ */ |