|
1 /** |
|
2 * Copyright (c) 2003-2009 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 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * CActiveReader & CActiveWriter |
|
16 * Contains basic Read and Write class Active objects for Socket I/O |
|
17 * |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 /** |
|
24 @file Activeio.h |
|
25 @internalComponent |
|
26 */ |
|
27 |
|
28 #ifndef __ACTIVE_IO_H |
|
29 #define __ACTIVE_IO_H |
|
30 |
|
31 #include <telsess.h> |
|
32 |
|
33 #define _TELNET_IOCTL_RECEIVE |
|
34 |
|
35 class MIONotifier; |
|
36 class MTelnetNotification; |
|
37 |
|
38 NONSHARABLE_CLASS(CActiveWriter) : public CActive |
|
39 /** |
|
40 @internalComponent |
|
41 */ |
|
42 { |
|
43 public: |
|
44 CActiveWriter(); |
|
45 ~CActiveWriter(); |
|
46 |
|
47 static CActiveWriter* NewL(MIONotifier* aNotifier); |
|
48 void ConstructL(MIONotifier* aNotifier); |
|
49 |
|
50 TInt IssueUrgentWrite(const TDesC8& aBuffer); |
|
51 TInt IssueWrite(const TDesC8& aBuffer); |
|
52 void SetSocket(RSocket* aSocket); |
|
53 |
|
54 void RunL(); |
|
55 void DoCancel(){} |
|
56 |
|
57 private: |
|
58 RSocket* iSocket; |
|
59 MIONotifier* iNotifier; |
|
60 TSockXfrLength iXfrLength; |
|
61 }; |
|
62 |
|
63 |
|
64 |
|
65 NONSHARABLE_CLASS(CActiveReader) : public CActive |
|
66 /** |
|
67 @internalComponent |
|
68 */ |
|
69 { |
|
70 |
|
71 public: |
|
72 CActiveReader(); |
|
73 ~CActiveReader(); |
|
74 |
|
75 static CActiveReader* NewL(MIONotifier* aNotifier); |
|
76 void ConstructL(MIONotifier* aNotifier); |
|
77 |
|
78 TInt IssueRead(TDes8& aBuffer); |
|
79 void SetSocket(RSocket* aSocket); |
|
80 |
|
81 void RunL(); |
|
82 void DoCancel(){} |
|
83 virtual TInt RunError(TInt aError); |
|
84 |
|
85 private: |
|
86 |
|
87 #ifdef _TELNET_IOCTL_RECEIVE |
|
88 |
|
89 enum TRequestCodes |
|
90 { |
|
91 ERequestNone, |
|
92 EReadRequest, |
|
93 EIOctlRequest |
|
94 }; |
|
95 |
|
96 TPckgBuf<TUint> iflags; |
|
97 TRequestCodes iRequest; |
|
98 TDes8* iClientBuffer; |
|
99 |
|
100 #endif |
|
101 |
|
102 RSocket* iSocket; |
|
103 MIONotifier* iNotifier; |
|
104 TSockXfrLength iXfrLength; |
|
105 }; |
|
106 |
|
107 #endif |