|
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 @deprecated |
|
20 */ |
|
21 #ifndef OBSERVERS_H_ |
|
22 #define OBSERVERS_H_ |
|
23 |
|
24 #include "suplmessagebase.h" |
|
25 |
|
26 #include <es_sock.h> |
|
27 #include <in_sock.h> |
|
28 |
|
29 |
|
30 /** Used to uniquely identify a session with a SUPL server |
|
31 */ |
|
32 typedef TUint32 TSuplLocalSessionId; |
|
33 |
|
34 /** Socket Writer Observer mixin definition. |
|
35 This class is implemented by observers of the Socket Writer, which invokes |
|
36 methods in this class to make the observers aware of events that occurred on their |
|
37 network sessions. |
|
38 */ |
|
39 class MSuplSocketObserver |
|
40 { |
|
41 public: |
|
42 |
|
43 enum TSuplConnectionError |
|
44 { |
|
45 EUndefinedConnectionError, |
|
46 EFailedToSend, |
|
47 EFailedToRead, |
|
48 ESocketError, |
|
49 EDisconnected, |
|
50 EFailedToHandshake, |
|
51 EFailedCertCheck, |
|
52 ETimeOut, |
|
53 EFailedToDecode, |
|
54 ETooMuchDataRead, |
|
55 ELastErrorCode |
|
56 }; |
|
57 |
|
58 /** Notification of success in the stablishment of a connection (per-session so that the |
|
59 connection manager doesn't notify sessions that already knew the connection was up) |
|
60 */ |
|
61 virtual void Connected(const TSuplLocalSessionId& sessionId, TInetAddr& aAddr) = 0; |
|
62 |
|
63 /** This method reports to the observer that an error has occurred in the socket that |
|
64 it is not possible to recover from. |
|
65 The observer should relay the error to all the users of this socket. |
|
66 */ |
|
67 virtual void ConnectionError(const TInt& aError, const TInt aSocketWriterIndex, const TSuplLocalSessionId& sessionId, TBool& aDelete) = 0; |
|
68 |
|
69 /** This method reports to the observer that a message has been received |
|
70 (ownership of the message is transferred) |
|
71 */ |
|
72 virtual void MessageReceived(CSuplMessageBase* aSuplMessage) = 0; |
|
73 }; |
|
74 |
|
75 #endif /*OBSERVERS_H_*/ |