|
1 // Copyright (c) 2006-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 #ifndef __MSOCKETCONTROLLER_H__ |
|
17 #define __MSOCKETCONTROLLER_H__ |
|
18 |
|
19 #include <e32std.h> |
|
20 |
|
21 /** |
|
22 The observer API for the socket reader and writer. It is used by the socket |
|
23 reader or writer to notify the socket controller of when either the input or |
|
24 output stream has been closed. It also provides name and port info for the |
|
25 remote host. |
|
26 @internalTechnology |
|
27 @prototype |
|
28 */ |
|
29 class MSocketController |
|
30 { |
|
31 public: |
|
32 /** The TStreamType enumerates the types of streams. */ |
|
33 enum TStreamType |
|
34 { |
|
35 /** The input stream. */ |
|
36 EInputStream = 0, |
|
37 /** The output stream. */ |
|
38 EOutputStream |
|
39 }; |
|
40 |
|
41 public: |
|
42 /** |
|
43 This notifies the socket controller that either the input or the output |
|
44 stream is closed. That stream is no longer valid. |
|
45 @param aError The error code explaining why the stream has closed. |
|
46 A value of KErrNone indicates that the stream |
|
47 observer requested that the stream be closed. |
|
48 @param aStreamType The stream that has been closed. |
|
49 */ |
|
50 virtual void StreamClosed(TInt aError, MSocketController::TStreamType aStreamType) =0; |
|
51 /** |
|
52 This notifies the socket controller that either the input or the output |
|
53 stream has been suspended. |
|
54 @param aStreamType The stream that has been suspended. |
|
55 */ |
|
56 virtual void StreamSuspended(MSocketController::TStreamType aSuspendedStream) =0; |
|
57 /** |
|
58 This notifies the socket controller that either the input or the output |
|
59 stream has been resumed. |
|
60 @param aStreamType The stream that has been resumed. |
|
61 */ |
|
62 virtual void StreamResumed(MSocketController::TStreamType aResumedStream) =0; |
|
63 /** |
|
64 Provides connection information to the socket controller. |
|
65 @param aRemoteHost The remote host. |
|
66 @param aRemotePort The remote port number. |
|
67 @param aLocalPort The local port being used. |
|
68 */ |
|
69 virtual void ConnectionInfo(TDes8& aRemoteHost, TUint16& aRemotePort, TUint16& aLocalPort) =0; |
|
70 }; |
|
71 |
|
72 #endif // __MSOCKETCONTROLLER_H__ |
|
73 |