1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>oscl_tcp_socket.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center>
<hr><h1>oscl_tcp_socket.h</h1><a href="oscl__tcp__socket_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
00002 <span class="preprocessor">#ifndef OSCL_TCP_SOCKET_H_INCLUDED</span>
00003 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_TCP_SOCKET_H_INCLUDED</span>
00004 <span class="preprocessor"></span>
00005 <span class="preprocessor">#ifndef OSCL_IP_SOCKET_H_INCLUDED</span>
00006 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__ip__socket_8h.html">oscl_ip_socket.h</a>"</span>
00007 <span class="preprocessor">#endif</span>
00008 <span class="preprocessor"></span>
00009 <span class="preprocessor">#ifndef OSCL_DEFALLOC_H_INCLUDED</span>
00010 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__defalloc_8h.html">oscl_defalloc.h</a>"</span>
00011 <span class="preprocessor">#endif</span>
00012 <span class="preprocessor"></span>
00013 <span class="preprocessor">#ifndef OSCL_VECTOR_H_INCLUDED</span>
00014 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__vector_8h.html">oscl_vector.h</a>"</span>
00015 <span class="preprocessor">#endif</span>
00016 <span class="preprocessor"></span>
00017 <span class="preprocessor">#ifndef OSCL_MEM_H_INCLUDED</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mem_8h.html">oscl_mem.h</a>"</span>
00019 <span class="preprocessor">#endif</span>
00020 <span class="preprocessor"></span>
00021 <span class="keyword">class </span><a class="code" href="classOsclBindMethod.html">OsclBindMethod</a>;
00022 <span class="keyword">class </span><a class="code" href="classOsclListenMethod.html">OsclListenMethod</a>;
00023 <span class="keyword">class </span><a class="code" href="classOsclConnectMethod.html">OsclConnectMethod</a>;
00024 <span class="keyword">class </span><a class="code" href="classOsclShutdownMethod.html">OsclShutdownMethod</a>;
00025 <span class="keyword">class </span><a class="code" href="classOsclAcceptMethod.html">OsclAcceptMethod</a>;
00026 <span class="keyword">class </span><a class="code" href="classOsclSendMethod.html">OsclSendMethod</a>;
00027 <span class="keyword">class </span><a class="code" href="classOsclRecvMethod.html">OsclRecvMethod</a>;
00028
<a name="l00031"></a><a class="code" href="classOsclTCPSocketI.html">00031</a> <span class="keyword">class </span><a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a> : <span class="keyword">public</span> <a class="code" href="classOsclIPSocketI.html">OsclIPSocketI</a>
00032 {
00033 <span class="keyword">public</span>:
00034 <span class="comment">//Synchronous methods</span>
00035 <span class="keyword">static</span> <a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a> *<a class="code" href="classOsclTCPSocketI.html#d0">NewL</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &a,
00036 <a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *aServ,
00037 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
00038 uint32 aId);
00039
00040 <span class="keyword">virtual</span> <a class="code" href="classOsclTCPSocketI.html#a0">~OsclTCPSocketI</a>();
00041
00042 int32 <a class="code" href="classOsclTCPSocketI.html#a1">Close</a>();
00043 <span class="keyword">inline</span> int32 <a class="code" href="classOsclTCPSocketI.html#a2">Listen</a>(<span class="keywordtype">int</span> aQueueSize);
00044 <span class="comment">//the returned value is platform-specific</span>
00045
00046 <a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a> *<a class="code" href="classOsclTCPSocketI.html#a3">GetAcceptedSocketL</a>(uint32 aId);
00047
00048 <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclTCPSocketI.html#a4">GetRecvData</a>(int32 *aLength) ;
00049 <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclTCPSocketI.html#a5">GetSendData</a>(int32 *aLength);
00050
00051 <span class="comment">//Asynchronous methods</span>
00052 <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a6">BindAsync</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress,
00053 int32 aTimeoutMsec = -1);
00054 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a7">CancelBind</a>();
00055
00056 <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a8">ListenAsync</a>(uint32 qsize,
00057 int32 aTimeoutMsec = -1);
00058 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a9">CancelListen</a>();
00059
00060 <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a10">Connect</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress,
00061 int32 aTimeoutMsec = -1);
00062 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a11">CancelConnect</a>();
00063
00064 <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a12">Shutdown</a>(<a class="code" href="oscl__socket__types_8h.html#a21">TPVSocketShutdown</a> aHow,
00065 int32 aTimeoutMsec = -1);
00066 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a13">CancelShutdown</a>();
00067
00068 <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a14">Accept</a>(int32 aTimeout = -1);
00069 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a15">CancelAccept</a>();
00070
00071 <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a16">Send</a>(<span class="keyword">const</span> uint8* &aPtr, uint32 aLen,
00072 int32 aTimeoutMsec = -1);
00073 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a17">CancelSend</a>();
00074
00075 <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a18">Recv</a>(uint8* &aPtr, uint32 aMaxLen,
00076 int32 aTimeoutMsec = -1);
00077 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a19">CancelRecv</a>();
00078
00079 <span class="keyword">private</span>:
00080 <span class="keyword">static</span> <a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a> *<a class="code" href="classOsclTCPSocketI.html#d0">NewL</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &a,
00081 <a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *aServ,
00082 <a class="code" href="classOsclSocketI.html">OsclSocketI</a> *aSocket,
00083 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
00084 uint32 aId);
00085
00086 <a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &a) : <a class="code" href="classOsclIPSocketI.html#b0">OsclIPSocketI</a>(a),
00087 iConnectMethod(<a class="code" href="group__osclbase.html#a81">NULL</a>),
00088 iShutdownMethod(<a class="code" href="group__osclbase.html#a81">NULL</a>),
00089 iAcceptMethod(<a class="code" href="group__osclbase.html#a81">NULL</a>),
00090 iSendMethod(<a class="code" href="group__osclbase.html#a81">NULL</a>),
00091 iRecvMethod(<a class="code" href="group__osclbase.html#a81">NULL</a>)
00092 {}
00093
00094 <span class="keywordtype">void</span> <a class="code" href="classOsclIPSocketI.html#b1">ConstructL</a>(<a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *aServ,
00095 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
00096 uint32 aId);
00097
00098 <span class="keywordtype">void</span> <a class="code" href="classOsclIPSocketI.html#b1">ConstructL</a>(<a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *aServ,
00099 <a class="code" href="classOsclSocketI.html">OsclSocketI</a> *aSocket,
00100 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
00101 uint32 aId);
00102
00103 <a class="code" href="classOsclBindMethod.html">OsclBindMethod</a> *iBindMethod;
00104 <a class="code" href="classOsclListenMethod.html">OsclListenMethod</a> *iListenMethod;
00105 <a class="code" href="classOsclConnectMethod.html">OsclConnectMethod</a> *iConnectMethod;
00106 <a class="code" href="classOsclShutdownMethod.html">OsclShutdownMethod</a> *iShutdownMethod;
00107 <a class="code" href="classOsclAcceptMethod.html">OsclAcceptMethod</a> *iAcceptMethod;
00108 <a class="code" href="classOsclSendMethod.html">OsclSendMethod</a> *iSendMethod;
00109 <a class="code" href="classOsclRecvMethod.html">OsclRecvMethod</a> *iRecvMethod;
00110 };
00111
00112 <span class="preprocessor">#include "<a class="code" href="oscl__socket__listen_8h.html">oscl_socket_listen.h</a>"</span>
00113 <span class="preprocessor">#include "<a class="code" href="oscl__socket__recv_8h.html">oscl_socket_recv.h</a>"</span>
00114 <span class="preprocessor">#include "<a class="code" href="oscl__socket__send_8h.html">oscl_socket_send.h</a>"</span>
00115 <span class="preprocessor">#include "<a class="code" href="oscl__socket__accept_8h.html">oscl_socket_accept.h</a>"</span>
00116 <span class="preprocessor">#include "<a class="code" href="oscl__socket__shutdown_8h.html">oscl_socket_shutdown.h</a>"</span>
00117 <span class="preprocessor">#include "<a class="code" href="oscl__socket__connect_8h.html">oscl_socket_connect.h</a>"</span>
00118 <span class="preprocessor">#include "<a class="code" href="oscl__socket__bind_8h.html">oscl_socket_bind.h</a>"</span>
00119
<a name="l00121"></a><a class="code" href="classOsclTCPSocketI.html#a2">00121</a> <span class="keyword">inline</span> int32 <a class="code" href="classOsclTCPSocketI.html#a2">OsclTCPSocketI::Listen</a>(<span class="keywordtype">int</span> aQueueSize)
00122 {
00123 <span class="keywordflow">return</span> <a class="code" href="classOsclIPSocketI.html#n4">iSocket</a>-><a class="code" href="classOsclSocketI.html#a6">Listen</a>(aQueueSize) ;
00124 }
00125
<a name="l00127"></a><a class="code" href="classOsclTCPSocketI.html#a4">00127</a> <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclTCPSocketI.html#a4">OsclTCPSocketI::GetRecvData</a>(int32 *aLength)
00128 {
00129 <span class="keywordflow">return</span> iRecvMethod-><a class="code" href="classOsclRecvMethod.html#a2">GetRecvData</a>(aLength);
00130 }
00131
<a name="l00133"></a><a class="code" href="classOsclTCPSocketI.html#a5">00133</a> <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclTCPSocketI.html#a5">OsclTCPSocketI::GetSendData</a>(int32 *aLength)
00134 {
00135 <span class="keywordflow">return</span> iSendMethod-><a class="code" href="classOsclSendMethod.html#a2">GetSendData</a>(aLength);
00136 }
00137
<a name="l00139"></a><a class="code" href="classOsclTCPSocketI.html#a6">00139</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a6">OsclTCPSocketI::BindAsync</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress,
00140 int32 aTimeout)
00141 {
00142 <span class="keywordflow">if</span> (!<a class="code" href="classOsclSocketIBase.html#d0">OsclSocketIBase::HasAsyncBind</a>())
00143 <span class="keywordflow">return</span> <a class="code" href="oscl__socket__types_8h.html#a20a14">EPVSocketFailure</a>;<span class="comment">//not available.</span>
00144
00145 <a class="code" href="classOsclIPSocketI.html#n1">iAddress</a>.<a class="code" href="classOsclNetworkAddress.html#m0">ipAddr</a>.<a class="code" href="classOsclNameString.html#a3">Set</a>(aAddress.<a class="code" href="classOsclNetworkAddress.html#m0">ipAddr</a>.<a class="code" href="classOsclNameString.html#a5">Str</a>());
00146 <a class="code" href="classOsclIPSocketI.html#n1">iAddress</a>.<a class="code" href="classOsclNetworkAddress.html#m1">port</a> = aAddress.<a class="code" href="classOsclNetworkAddress.html#m1">port</a>;
00147 <span class="keywordflow">return</span> (iBindMethod-><a class="code" href="classOsclBindMethod.html#a1">Bind</a>(aAddress, aTimeout));
00148 }
00149
<a name="l00150"></a><a class="code" href="classOsclTCPSocketI.html#a7">00150</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a7">OsclTCPSocketI::CancelBind</a>()
00151 {
00152 iBindMethod-><a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00153 }
00154
<a name="l00156"></a><a class="code" href="classOsclTCPSocketI.html#a8">00156</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a8">OsclTCPSocketI::ListenAsync</a>(uint32 qsize,
00157 int32 aTimeout)
00158 {
00159 <span class="keywordflow">if</span> (!<a class="code" href="classOsclSocketIBase.html#d1">OsclSocketIBase::HasAsyncListen</a>())
00160 <span class="keywordflow">return</span> <a class="code" href="oscl__socket__types_8h.html#a20a14">EPVSocketFailure</a>;<span class="comment">//not available</span>
00161
00162 <span class="keywordflow">return</span> (iListenMethod-><a class="code" href="classOsclListenMethod.html#a1">Listen</a>(qsize, aTimeout));
00163 }
00164
<a name="l00165"></a><a class="code" href="classOsclTCPSocketI.html#a9">00165</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a9">OsclTCPSocketI::CancelListen</a>()
00166 {
00167 iListenMethod-><a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00168 }
00169
<a name="l00171"></a><a class="code" href="classOsclTCPSocketI.html#a10">00171</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a10">OsclTCPSocketI::Connect</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress,
00172 int32 aTimeout)
00173 {
00174 <span class="keywordflow">return</span> (iConnectMethod-><a class="code" href="classOsclConnectMethod.html#a1">Connect</a>(aAddress, aTimeout));
00175 }
00176
<a name="l00177"></a><a class="code" href="classOsclTCPSocketI.html#a11">00177</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a11">OsclTCPSocketI::CancelConnect</a>()
00178 {
00179 iConnectMethod-><a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00180 }
00181
<a name="l00183"></a><a class="code" href="classOsclTCPSocketI.html#a12">00183</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a12">OsclTCPSocketI::Shutdown</a>(<a class="code" href="oscl__socket__types_8h.html#a21">TPVSocketShutdown</a> aHow,
00184 int32 aTimeout)
00185 {
00186 <span class="keywordflow">return</span> (iShutdownMethod-><a class="code" href="classOsclShutdownMethod.html#a1">Shutdown</a>(aHow, aTimeout));
00187 }
00188
<a name="l00189"></a><a class="code" href="classOsclTCPSocketI.html#a13">00189</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a13">OsclTCPSocketI::CancelShutdown</a>()
00190 {
00191 iShutdownMethod-><a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00192 }
00193
<a name="l00195"></a><a class="code" href="classOsclTCPSocketI.html#a14">00195</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a14">OsclTCPSocketI::Accept</a>(int32 aTimeout)
00196 {
00197 <span class="keywordflow">return</span> (iAcceptMethod-><a class="code" href="classOsclAcceptMethod.html#a1">Accept</a>(aTimeout));
00198 }
00199
<a name="l00200"></a><a class="code" href="classOsclTCPSocketI.html#a15">00200</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a15">OsclTCPSocketI::CancelAccept</a>()
00201 {
00202 iAcceptMethod-><a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00203 }
00204
<a name="l00206"></a><a class="code" href="classOsclTCPSocketI.html#a16">00206</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a16">OsclTCPSocketI::Send</a>(<span class="keyword">const</span> uint8* &aPtr, uint32 aLen,
00207 int32 aTimeoutMsec)
00208 {
00209 <span class="keywordflow">return</span> (iSendMethod-><a class="code" href="classOsclSendMethod.html#a1">Send</a>(aPtr, aLen, aTimeoutMsec));
00210 }
00211
<a name="l00212"></a><a class="code" href="classOsclTCPSocketI.html#a17">00212</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a17">OsclTCPSocketI::CancelSend</a>()
00213 {
00214 iSendMethod-><a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00215 }
00216
<a name="l00218"></a><a class="code" href="classOsclTCPSocketI.html#a18">00218</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocketI.html#a18">OsclTCPSocketI::Recv</a>(uint8* &aPtr, uint32 aMaxLen,
00219 int32 aTimeout)
00220 {
00221 <span class="keywordflow">return</span> (iRecvMethod-><a class="code" href="classOsclRecvMethod.html#a1">Recv</a>(aPtr, aMaxLen, aTimeout));
00222 }
00223
<a name="l00224"></a><a class="code" href="classOsclTCPSocketI.html#a19">00224</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocketI.html#a19">OsclTCPSocketI::CancelRecv</a>()
00225 {
00226 iRecvMethod-><a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00227 }
00228
00229 <span class="preprocessor">#endif</span>
00230 <span class="preprocessor"></span>
</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
</small></address>
</body>
</html>
|