|
1 // server.h |
|
2 // |
|
3 // Copyright (c) 2009 - 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 __SERVER_H__ |
|
14 #define __SERVER_H__ |
|
15 |
|
16 static const TInt KServerShutdownTimer = 500000; |
|
17 |
|
18 TInt ServerThreadFunction(TAny* aArgs); |
|
19 |
|
20 class TServerParams |
|
21 { |
|
22 public: |
|
23 TServerNewL iServerNewL; |
|
24 TAny* iServerParams; |
|
25 RServer2 iServer; |
|
26 }; |
|
27 |
|
28 NONSHARABLE_CLASS(CConsoleWrapper) : public CActive |
|
29 , public MProxiedConsole |
|
30 { |
|
31 public: |
|
32 static CConsoleWrapper* NewL(TConsoleCreateFunction aConsoleCreate); |
|
33 static CConsoleWrapper* NewL(CConsoleBase* aConsole); |
|
34 ~CConsoleWrapper(); |
|
35 private: |
|
36 // from MProxiedConsole: |
|
37 virtual void Open(); |
|
38 virtual void Close(); |
|
39 virtual CConsoleBase* Console(); |
|
40 virtual void Read(CConsoleProxySession& aSession); |
|
41 virtual void ReadCancel(); |
|
42 // from CActive: |
|
43 virtual void RunL(); |
|
44 virtual void DoCancel(); |
|
45 private: |
|
46 void ConstructL(TConsoleCreateFunction aConsoleCreate); |
|
47 CConsoleWrapper(); |
|
48 private: |
|
49 TInt iRefCount; |
|
50 CConsoleBase* iConsole; |
|
51 CConsoleProxySession* iReader; |
|
52 }; |
|
53 |
|
54 NONSHARABLE_CLASS(CShutdownTimer) : public CTimer |
|
55 { |
|
56 public: |
|
57 static CShutdownTimer* NewL(CConsoleProxyServer& aServer); |
|
58 void Start(); |
|
59 private: |
|
60 CShutdownTimer(CConsoleProxyServer& aServer); |
|
61 virtual void RunL(); |
|
62 private: |
|
63 CConsoleProxyServer& iServer; |
|
64 }; |
|
65 |
|
66 |
|
67 |
|
68 #endif //__SERVER_H__ |