|
1 /* |
|
2 * Copyright (c) 2005-2006 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: fcsender.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CFCSENDER_H__ |
|
22 #define __CFCSENDER_H__ |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <in_sock.h> |
|
26 |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MFCNotifier; |
|
30 |
|
31 /** |
|
32 * Class provides functions for Sending |
|
33 * |
|
34 * CFCSender Class provides functions for Sending |
|
35 * |
|
36 * @lib FCTBCP.lib |
|
37 * @since S60 v3.0 |
|
38 */ |
|
39 class CFCSender : public CActive |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Static constructor. |
|
44 * @param aSocket Reference to Socket |
|
45 * @param aNotifier, MFCNotifier |
|
46 * @return An initialized instance of this class. |
|
47 */ |
|
48 static CFCSender* NewL(RSocket& aSocket, MFCNotifier& aNotifier); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 ~CFCSender (); |
|
54 |
|
55 /** |
|
56 * Sending the data to the addr |
|
57 * @param aData, Data to send |
|
58 * @param aAddr, the remote address |
|
59 */ |
|
60 void SendL (HBufC8* aData, TInetAddr& aAddr); |
|
61 |
|
62 void ConnectedL(); |
|
63 |
|
64 protected: // From CActive |
|
65 void RunL (); |
|
66 void DoCancel (); |
|
67 TInt RunError (TInt aError); |
|
68 |
|
69 private: |
|
70 /** |
|
71 * Constructor |
|
72 * @param aSocket Reference to Socket |
|
73 * @param aNotifier, MFCNotifier |
|
74 * @return An initialized instance of this class. |
|
75 */ |
|
76 CFCSender (RSocket& aSocket, MFCNotifier& aNotifier); |
|
77 |
|
78 void SendFromBufferL(); |
|
79 |
|
80 private: //Data |
|
81 RSocket* iSocket; |
|
82 RSocketServ* iSocketServ; |
|
83 |
|
84 RPointerArray<HBufC8> iSendBuffer; |
|
85 HBufC8* iData; |
|
86 |
|
87 TPtrC8 iOutgoingData; |
|
88 TInetAddr iRemoteAddr; |
|
89 MFCNotifier& iFCNotifier; |
|
90 TInt iErr; |
|
91 |
|
92 TBool iConnected; |
|
93 |
|
94 private: // For testing purposes |
|
95 friend class UT_CFCSender; |
|
96 }; |
|
97 |
|
98 #endif // end of __CFCSENDER_H__ |
|
99 |
|
100 // End of File |