1 /* |
|
2 * Copyright (c) 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: The error notification interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __SOCKETOBSERVER_H__ |
|
20 #define __SOCKETOBSERVER_H__ |
|
21 |
|
22 // CLASS DECLARATION |
|
23 |
|
24 /** |
|
25 * MEngineNotifier. |
|
26 * This class specifies the error notification interface. |
|
27 */ |
|
28 class MSocketObserver |
|
29 { |
|
30 public: // Enumerations |
|
31 |
|
32 /** |
|
33 * TErrorType. |
|
34 * Error types encountered when reading/writing to a sockets. |
|
35 * - EDisconnected. A disconnected error has been encountered. |
|
36 * - ETimeOutOnWrite. A write operation has failed to complete |
|
37 * within a predetermined period. |
|
38 * - EGeneralReadError. A general error has been encountered |
|
39 * during a read. |
|
40 * - EGeneralWriteError. A general error has been encountered |
|
41 * during a write |
|
42 */ |
|
43 enum TErrorType |
|
44 { |
|
45 EDisconnected, |
|
46 ETimeOutOnWrite, |
|
47 EGeneralReadError, |
|
48 EGeneralWriteError |
|
49 }; |
|
50 |
|
51 public: // New functions |
|
52 |
|
53 /** |
|
54 * ReportError. |
|
55 * Reports a communication error. |
|
56 * @param aErrorType Error type. |
|
57 * @param aErrorCode Associated error code. |
|
58 */ |
|
59 virtual void ReportError( TErrorType aErrorType, TInt aErrorCode ) = 0; |
|
60 |
|
61 /** |
|
62 * NewData. |
|
63 * Data has been received on the socket and read into a buffer. |
|
64 * @param aData The data buffer. |
|
65 */ |
|
66 virtual void NewData(const TDesC8& aData) = 0; |
|
67 |
|
68 virtual void AllBufferedDataSent() = 0; |
|
69 }; |
|
70 |
|
71 #endif // __SOCKETOBSERVER_H__ |
|
72 |
|
73 // End of File |
|