|
1 // Copyright (c) 2008-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 // mdnsserversession.h |
|
15 // |
|
16 // |
|
17 /** |
|
18 @file |
|
19 @internalTechnology |
|
20 */ |
|
21 |
|
22 #ifndef __MDNSSERVERSESSION_H__ |
|
23 #define __MDNSSERVERSESSION_H__ |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <pnp/pnpparameterbundle.h> |
|
27 #include <mdns/mdnsparamset.h> |
|
28 #include <mdns/ccacheentry.h> |
|
29 |
|
30 //User Include |
|
31 #include "cmessagehandler.h" |
|
32 #include "mdnsdebug.h" |
|
33 class CMdnsServer; |
|
34 |
|
35 |
|
36 class CMdnsServerSession : public CSession2 |
|
37 { |
|
38 public: |
|
39 static CMdnsServerSession* NewL(const CMdnsServer& aServer); |
|
40 static CMdnsServerSession* NewLC(const CMdnsServer& aServer); |
|
41 |
|
42 void ServiceL(const RMessage2& aMessage); |
|
43 void ServiceError(const RMessage2& aMessage, TInt aError); |
|
44 TInt OutStandQueryClientHandle()const; |
|
45 void SendResponseL(); |
|
46 //void HandleNameChangeL(); |
|
47 void HandleServiceNameConflictL(const RBuf8& aName,TInt aError); |
|
48 void ServiceQueryL(const RMessage2& aMessage); |
|
49 void PublishL(const RMessage2& aMessage); |
|
50 void NewServiceL(const RArray<RBuf8>& aName); |
|
51 TInt SessionId(); |
|
52 ~CMdnsServerSession(); |
|
53 |
|
54 private: |
|
55 CMdnsServerSession(const CMdnsServer& aServer); |
|
56 void ConstructL(); |
|
57 TInt CountResources(); |
|
58 void RegisterNotifyL(const RMessage2& aMessage); |
|
59 void ServerVersionL(const RMessage2& aMessage); |
|
60 void StopNotifyL (const RMessage2& aMessage); |
|
61 void CleanUp(); |
|
62 void CreateAnyQueryResponseL(CCacheEntry& aEntry); |
|
63 private: |
|
64 CMdnsServer& iServer; |
|
65 RMessage2 iClientQuery; |
|
66 RMessage2 iPublishRequest; |
|
67 RMessage2 iNotifyMessageRequest; |
|
68 RPnPParameterBundle iQueryBundle; |
|
69 RPnPParameterBundle iResponseBundle; |
|
70 RPnPParameterBundle iPublishBundle; |
|
71 RArray<RBuf8> iRegisterNotifyArray; |
|
72 |
|
73 //TInt iNextSubsessionId; |
|
74 TInt iSessionId; |
|
75 TBool iIsNotifyRequested; |
|
76 |
|
77 TInt iLastTypeSent; |
|
78 |
|
79 TInt iLastServiceSent; |
|
80 /** |
|
81 *FLOGGER debug trace member variable. |
|
82 */ |
|
83 __FLOG_DECLARATION_MEMBER_MUTABLE; |
|
84 }; |
|
85 |
|
86 #endif /* __MDNSSERVERSESSION_H__ */ |