|
1 |
|
2 /* |
|
3 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Initial Contributors: |
|
11 * Nokia Corporation - initial contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CSIPEXSOCKETREADER_H__ |
|
22 #define __CSIPEXSOCKETREADER_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MSIPExReaderNotifier; |
|
28 class RSocket; |
|
29 |
|
30 /** |
|
31 * CSIPExSocketReader |
|
32 * Reads data from the connected socket. |
|
33 */ |
|
34 class CSIPExSocketReader : public CActive |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * NewL |
|
40 * Static constructor |
|
41 * @param aSocket The reference to the socket |
|
42 * @param aNotifier The reference to the reader notifier |
|
43 */ |
|
44 static CSIPExSocketReader* NewL( RSocket& aSocket, MSIPExReaderNotifier& aNotifier ); |
|
45 |
|
46 /** |
|
47 * NewLC |
|
48 * Static constructor. On return the instance is left to the CleanupStack. |
|
49 * @param aSocket The reference to the socket |
|
50 * @param aNotifier The reference to the reader notifier |
|
51 */ |
|
52 static CSIPExSocketReader* NewLC( RSocket& aSocket, MSIPExReaderNotifier& aNotifier ); |
|
53 |
|
54 /** |
|
55 * ~CSIPExSocketReader |
|
56 * Destructor |
|
57 */ |
|
58 ~CSIPExSocketReader(); |
|
59 |
|
60 public: |
|
61 |
|
62 /** |
|
63 * Read |
|
64 * Asynchronous function. |
|
65 * Starts the asynchronous reading. |
|
66 */ |
|
67 void Read(); |
|
68 |
|
69 protected: // from CActive |
|
70 |
|
71 /** |
|
72 * From CActive |
|
73 */ |
|
74 void DoCancel(); |
|
75 |
|
76 /** |
|
77 * From CActive |
|
78 */ |
|
79 void RunL(); |
|
80 |
|
81 private: |
|
82 |
|
83 /** |
|
84 * CSIPExSocketReader |
|
85 * Constructor |
|
86 * @param aSocket The reference to the socket |
|
87 * @param aNotifier The reference to the reader notifier |
|
88 */ |
|
89 CSIPExSocketReader( RSocket& aSocket, MSIPExReaderNotifier& aNotifier ); |
|
90 |
|
91 /** |
|
92 * ConstructL |
|
93 * Symbian 2nd phase constructor that might leave |
|
94 */ |
|
95 void ConstructL(); |
|
96 |
|
97 private: |
|
98 // Member variables |
|
99 |
|
100 // Ref: Reader notifier |
|
101 MSIPExReaderNotifier& iNotifier; |
|
102 |
|
103 // Ref: Data socket |
|
104 RSocket& iSocket; |
|
105 |
|
106 // Buffers |
|
107 TBuf8<1> iBuffer; |
|
108 TBuf8<256> iMessage; |
|
109 }; |
|
110 |
|
111 #endif // __CSIPEXSOCKETREADER_H__ |
|
112 |
|
113 // end of file |