blob: d00f1ec5b0b1f15fffd839e4ebd6502aff1e3086 [file] [log] [blame]
<!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_udp_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> &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>
<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
00002 <span class="preprocessor">#ifndef OSCL_UDP_SOCKET_H_INCLUDED</span>
00003 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_UDP_SOCKET_H_INCLUDED</span>
00004 <span class="preprocessor"></span>
00005 <span class="preprocessor">#include "<a class="code" href="oscl__ip__socket_8h.html">oscl_ip_socket.h</a>"</span>
00006 <span class="preprocessor">#include "<a class="code" href="oscl__defalloc_8h.html">oscl_defalloc.h</a>"</span>
00007
00008 <span class="keyword">class </span><a class="code" href="classOsclSendToMethod.html">OsclSendToMethod</a>;
00009 <span class="keyword">class </span><a class="code" href="classOsclRecvFromMethod.html">OsclRecvFromMethod</a>;
00010 <span class="keyword">class </span><a class="code" href="classOsclBindMethod.html">OsclBindMethod</a>;
00011
<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>
00015 {
00016 <span class="keyword">public</span>:
00017 <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,
00018 <a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *aServ,
00019 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
00020 uint32 aId);
00021
00022 <span class="keyword">virtual</span> <a class="code" href="classOsclUDPSocketI.html#a0">~OsclUDPSocketI</a>();
00023
00024 <span class="comment">//Synchronous methods</span>
00025 int32 <a class="code" href="classOsclUDPSocketI.html#a1">Close</a>();
00026 <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclUDPSocketI.html#a2">GetRecvData</a>(int32 *aLength);
00027 <span class="keyword">inline</span> uint8 *<a class="code" href="classOsclUDPSocketI.html#a3">GetSendData</a>(int32 *aLength);
00028
00029 <span class="comment">//Asynchronous methods</span>
00030 <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,
00031 int32 aTimeoutMsec = -1);
00032 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a5">CancelBind</a>();
00033
00034 <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,
00035 <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
00036 int32 aTimeoutMsec = -1);
00037 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a7">CancelSendTo</a>();
00038
00039 <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,
00040 <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
00041 int32 aTimeoutMsec = -1,
00042 uint32 aMultiMaxLen = 0,
00043 <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>,
00044 <a class="code" href="classOscl__Vector.html">Oscl_Vector&lt;OsclNetworkAddress, OsclMemAllocator&gt;</a>* aPacketSource = NULL);
00045 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocketI.html#a9">CancelRecvFrom</a>();
00046
00047 <span class="keyword">private</span>:
00048 <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),
00049 iRecvFromMethod(NULL)
00050 {}
00051
00052 <span class="keywordtype">void</span> <a class="code" href="classOsclIPSocketI.html#b1">ConstructL</a>(<a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *aServ,
00053 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
00054 uint32 aId);
00055
00056 <a class="code" href="classOsclBindMethod.html">OsclBindMethod</a> *iBindMethod;
00057 <a class="code" href="classOsclSendToMethod.html">OsclSendToMethod</a> *iSendToMethod;
00058 <a class="code" href="classOsclRecvFromMethod.html">OsclRecvFromMethod</a> *iRecvFromMethod;
00059 };
00060
00061 <span class="preprocessor">#include "<a class="code" href="oscl__socket__recv__from_8h.html">oscl_socket_recv_from.h</a>"</span>
00062 <span class="preprocessor">#include "<a class="code" href="oscl__socket__send__to_8h.html">oscl_socket_send_to.h</a>"</span>
00063 <span class="preprocessor">#include "<a class="code" href="oscl__socket__bind_8h.html">oscl_socket_bind.h</a>"</span>
00064
<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)
00067 {
00068 <span class="keywordflow">return</span> iRecvFromMethod-&gt;<a class="code" href="classOsclRecvFromMethod.html#a2">GetRecvData</a>(aLength);
00069 }
00070
<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)
00073 {
00074 <span class="keywordflow">return</span> iSendToMethod-&gt;<a class="code" href="classOsclSendToMethod.html#a2">GetSendData</a>(aLength);
00075 }
00076
<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,
00079 int32 aTimeoutMsec)
00080 {
00081 <span class="keywordflow">if</span> (!<a class="code" href="classOsclSocketIBase.html#d0">OsclSocketIBase::HasAsyncBind</a>())
00082 <span class="keywordflow">return</span> <a class="code" href="oscl__socket__types_8h.html#a20a14">EPVSocketFailure</a>;<span class="comment">//not available.</span>
00083
00084 <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>());
00085 <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>;
00086 <span class="keywordflow">return</span> (iBindMethod-&gt;<a class="code" href="classOsclBindMethod.html#a1">Bind</a>(aAddress, aTimeoutMsec));
00087 }
00088
<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>()
00090 {
00091 iBindMethod-&gt;<a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00092 }
00093
<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,
00096 <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
00097 int32 aTimeoutMsec)
00098 {
00099 <span class="keywordflow">return</span> (iSendToMethod-&gt;<a class="code" href="classOsclSendToMethod.html#a1">SendTo</a>(aPtr, aLen, aAddress, aTimeoutMsec));
00100 }
00101
<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>()
00103 {
00104 iSendToMethod-&gt;<a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00105 }
00106
<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,
00109 <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
00110 int32 aTimeoutMsec, uint32 aMultiMax,
00111 <a class="code" href="classOscl__Vector.html">Oscl_Vector&lt;uint32, OsclMemAllocator&gt;</a>* aPacketLen,
00112 <a class="code" href="classOscl__Vector.html">Oscl_Vector&lt;OsclNetworkAddress, OsclMemAllocator&gt;</a>* aPacketSource)
00113 {
00114 <span class="keywordflow">return</span> (iRecvFromMethod-&gt;<a class="code" href="classOsclRecvFromMethod.html#a1">RecvFrom</a>(aPtr, aMaxLen, aAddress, aTimeoutMsec, aMultiMax, aPacketLen, aPacketSource));
00115 }
00116
<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>()
00118 {
00119 iRecvFromMethod-&gt;<a class="code" href="classOsclSocketMethod.html#a4">CancelMethod</a>();
00120 }
00121
00122 <span class="preprocessor">#endif</span>
00123 <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>