• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>oscl_udp_socket.h Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5</head><body>
6<!-- Generated by Doxygen 1.2.18 -->
7<center>
8<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
9<hr><h1>oscl_udp_socket.h</h1><a href="oscl__udp__socket_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001
1000002 <span class="preprocessor">#ifndef OSCL_UDP_SOCKET_H_INCLUDED</span>
1100003 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_UDP_SOCKET_H_INCLUDED</span>
1200004 <span class="preprocessor"></span>
1300005 <span class="preprocessor">#include "<a class="code" href="oscl__ip__socket_8h.html">oscl_ip_socket.h</a>"</span>
1400006 <span class="preprocessor">#include "<a class="code" href="oscl__defalloc_8h.html">oscl_defalloc.h</a>"</span>
1500007
1600008 <span class="keyword">class </span><a class="code" href="classOsclSendToMethod.html">OsclSendToMethod</a>;
1700009 <span class="keyword">class </span><a class="code" href="classOsclRecvFromMethod.html">OsclRecvFromMethod</a>;
1800010 <span class="keyword">class </span><a class="code" href="classOsclBindMethod.html">OsclBindMethod</a>;
1900011
20<a name="l00014"></a><a class="code" href="classOsclUDPSocketI.html">00014</a> <span class="keyword">class </span><a class="code" href="classOsclUDPSocketI.html">OsclUDPSocketI</a> : <span class="keyword">public</span> <a class="code" href="classOsclIPSocketI.html">OsclIPSocketI</a>
2100015 {
2200016     <span class="keyword">public</span>:
2300017         <span class="keyword">static</span> <a class="code" href="classOsclUDPSocketI.html">OsclUDPSocketI</a> *<a class="code" href="classOsclUDPSocketI.html#d0">NewL</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;a,
2400018                                     <a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *aServ,
2500019                                     <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
2600020                                     uint32 aId);
2700021
2800022         <span class="keyword">virtual</span> <a class="code" href="classOsclUDPSocketI.html#a0">~OsclUDPSocketI</a>();
2900023
3000024         <span class="comment">//Synchronous methods</span>
3100025         int32 <a class="code" href="classOsclUDPSocketI.html#a1">Close</a>();
3200026         <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclUDPSocketI.html#a2">GetRecvData</a>(int32 *aLength);
3300027         <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclUDPSocketI.html#a3">GetSendData</a>(int32 *aLength);
3400028
3500029         <span class="comment">//Asynchronous methods</span>
3600030         <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocketI.html#a4">BindAsync</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
3700031                                         int32 aTimeoutMsec = -1);
3800032         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a5">CancelBind</a>();
3900033
4000034         <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocketI.html#a6">SendTo</a>(<span class="keyword">const</span> uint8* &amp;aPtr, uint32 aLen,
4100035                                      <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
4200036                                      int32 aTimeoutMsec = -1);
4300037         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a7">CancelSendTo</a>();
4400038
4500039         <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocketI.html#a8">RecvFrom</a>(uint8* &amp;aPtr, uint32 aMaxLen,
4600040                                        <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
4700041                                        int32 aTimeoutMsec = -1,
4800042                                        uint32 aMultiMaxLen = 0,
4900043                                        <a class="code" href="classOscl__Vector.html">Oscl_Vector&lt;uint32, OsclMemAllocator&gt;</a>* aPacketLen = <a class="code" href="group__osclbase.html#a81">NULL</a>,
5000044                                        <a class="code" href="classOscl__Vector.html">Oscl_Vector&lt;OsclNetworkAddress, OsclMemAllocator&gt;</a>* aPacketSource = NULL);
5100045         <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a9">CancelRecvFrom</a>();
5200046
5300047     <span class="keyword">private</span>:
5400048         <a class="code" href="classOsclUDPSocketI.html">OsclUDPSocketI</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;a) : <a class="code" href="classOsclIPSocketI.html#b0">OsclIPSocketI</a>(a), iSendToMethod(NULL),
5500049                 iRecvFromMethod(NULL)
5600050         {}
5700051
5800052         <span class="keywordtype">void</span> <a class="code" href="classOsclIPSocketI.html#b1">ConstructL</a>(<a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *aServ,
5900053                         <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
6000054                         uint32 aId);
6100055
6200056         <a class="code" href="classOsclBindMethod.html">OsclBindMethod</a> *iBindMethod;
6300057         <a class="code" href="classOsclSendToMethod.html">OsclSendToMethod</a> *iSendToMethod;
6400058         <a class="code" href="classOsclRecvFromMethod.html">OsclRecvFromMethod</a> *iRecvFromMethod;
6500059 };
6600060
6700061 <span class="preprocessor">#include "<a class="code" href="oscl__socket__recv__from_8h.html">oscl_socket_recv_from.h</a>"</span>
6800062 <span class="preprocessor">#include "<a class="code" href="oscl__socket__send__to_8h.html">oscl_socket_send_to.h</a>"</span>
6900063 <span class="preprocessor">#include "<a class="code" href="oscl__socket__bind_8h.html">oscl_socket_bind.h</a>"</span>
7000064
71<a name="l00066"></a><a class="code" href="classOsclUDPSocketI.html#a2">00066</a> <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclUDPSocketI.html#a2">OsclUDPSocketI::GetRecvData</a>(int32 *aLength)
7200067 {
7300068     <span class="keywordflow">return</span> iRecvFromMethod-&gt;<a class="code" href="classOsclRecvFromMethod.html#a2">GetRecvData</a>(aLength);
7400069 }
7500070
76<a name="l00072"></a><a class="code" href="classOsclUDPSocketI.html#a3">00072</a> <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclUDPSocketI.html#a3">OsclUDPSocketI::GetSendData</a>(int32 *aLength)
7700073 {
7800074     <span class="keywordflow">return</span> iSendToMethod-&gt;<a class="code" href="classOsclSendToMethod.html#a2">GetSendData</a>(aLength);
7900075 }
8000076
81<a name="l00078"></a><a class="code" href="classOsclUDPSocketI.html#a4">00078</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocketI.html#a4">OsclUDPSocketI::BindAsync</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
8200079         int32 aTimeoutMsec)
8300080 {
8400081     <span class="keywordflow">if</span> (!<a class="code" href="classOsclSocketIBase.html#d0">OsclSocketIBase::HasAsyncBind</a>())
8500082         <span class="keywordflow">return</span> <a class="code" href="oscl__socket__types_8h.html#a20a14">EPVSocketFailure</a>;<span class="comment">//not available.</span>
8600083
8700084     <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>());
8800085     <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>;
8900086     <span class="keywordflow">return</span> (iBindMethod-&gt;<a class="code" href="classOsclBindMethod.html#a1">Bind</a>(aAddress, aTimeoutMsec));
9000087 }
9100088
92<a name="l00089"></a><a class="code" href="classOsclUDPSocketI.html#a5">00089</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a5">OsclUDPSocketI::CancelBind</a>()
9300090 {
9400091     iBindMethod-&gt;<a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
9500092 }
9600093
97<a name="l00095"></a><a class="code" href="classOsclUDPSocketI.html#a6">00095</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocketI.html#a6">OsclUDPSocketI::SendTo</a>(<span class="keyword">const</span> uint8* &amp;aPtr, uint32 aLen,
9800096         <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
9900097         int32 aTimeoutMsec)
10000098 {
10100099     <span class="keywordflow">return</span> (iSendToMethod-&gt;<a class="code" href="classOsclSendToMethod.html#a1">SendTo</a>(aPtr, aLen, aAddress, aTimeoutMsec));
10200100 }
10300101
104<a name="l00102"></a><a class="code" href="classOsclUDPSocketI.html#a7">00102</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a7">OsclUDPSocketI::CancelSendTo</a>()
10500103 {
10600104     iSendToMethod-&gt;<a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
10700105 }
10800106
109<a name="l00108"></a><a class="code" href="classOsclUDPSocketI.html#a8">00108</a> <span class="keyword">inline</span> <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocketI.html#a8">OsclUDPSocketI::RecvFrom</a>(uint8* &amp;aPtr, uint32 aMaxLen,
11000109         <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
11100110         int32 aTimeoutMsec, uint32 aMultiMax,
11200111         <a class="code" href="classOscl__Vector.html">Oscl_Vector&lt;uint32, OsclMemAllocator&gt;</a>* aPacketLen,
11300112         <a class="code" href="classOscl__Vector.html">Oscl_Vector&lt;OsclNetworkAddress, OsclMemAllocator&gt;</a>* aPacketSource)
11400113 {
11500114     <span class="keywordflow">return</span> (iRecvFromMethod-&gt;<a class="code" href="classOsclRecvFromMethod.html#a1">RecvFrom</a>(aPtr, aMaxLen, aAddress, aTimeoutMsec, aMultiMax, aPacketLen, aPacketSource));
11600115 }
11700116
118<a name="l00117"></a><a class="code" href="classOsclUDPSocketI.html#a9">00117</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a9">OsclUDPSocketI::CancelRecvFrom</a>()
11900118 {
12000119     iRecvFromMethod-&gt;<a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
12100120 }
12200121
12300122 <span class="preprocessor">#endif</span>
12400123 <span class="preprocessor"></span>
125</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
126<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
127</small></address>
128</body>
129</html>
130