blob: 70925556162cf6011145311a2436763ea414c9ff [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_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_socket.h</h1><a href="oscl__socket_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// -*- c++ -*-</span>
00002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
00003
00004 <span class="comment">// O S C L _ S O C K E T</span>
00005
00006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span>
00007
00018 <span class="preprocessor">#ifndef OSCL_SOCKET_H_INCLUDED</span>
00019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_SOCKET_H_INCLUDED</span>
00020 <span class="preprocessor"></span>
00021 <span class="preprocessor">#ifndef OSCLCONFIG_IO_H_INCLUDED</span>
00022 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="osclconfig__io_8h.html">osclconfig_io.h</a>"</span>
00023 <span class="preprocessor">#endif</span>
00024 <span class="preprocessor"></span>
00025 <span class="preprocessor">#ifndef OSCL_SOCKET_TYPES_H_INCLUDED</span>
00026 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__socket__types_8h.html">oscl_socket_types.h</a>"</span>
00027 <span class="preprocessor">#endif</span>
00028 <span class="preprocessor"></span>
00029 <span class="preprocessor">#ifndef OSCL_HEAPBASE_H_INCLUDED</span>
00030 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__heapbase_8h.html">oscl_heapbase.h</a>"</span>
00031 <span class="preprocessor">#endif</span>
00032 <span class="preprocessor"></span>
00033 <span class="preprocessor">#ifndef OSCL_DEFALLOC_H_INCLUDED</span>
00034 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__defalloc_8h.html">oscl_defalloc.h</a>"</span>
00035 <span class="preprocessor">#endif</span>
00036 <span class="preprocessor"></span>
00037 <span class="preprocessor">#ifndef OSCL_VECTOR_H_INCLUDED</span>
00038 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__vector_8h.html">oscl_vector.h</a>"</span>
00039 <span class="preprocessor">#endif</span>
00040 <span class="preprocessor"></span>
00041 <span class="preprocessor">#ifndef OSCL_MEM_H_INCLUDED</span>
00042 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mem_8h.html">oscl_mem.h</a>"</span>
00043 <span class="preprocessor">#endif</span>
00044 <span class="preprocessor"></span>
00048 <span class="keyword">class </span><a class="code" href="classOsclSocketServI.html">OsclSocketServI</a>;
00049
<a name="l00050"></a><a class="code" href="classOsclSocketServ.html">00050</a> <span class="keyword">class </span><a class="code" href="classOsclSocketServ.html">OsclSocketServ</a> : <span class="keyword">public</span> <a class="code" href="classHeapBase.html">HeapBase</a>
00051 {
00052 <span class="keyword">public</span>:
00060 OSCL_IMPORT_REF <span class="keyword">static</span> <a class="code" href="classOsclSocketServ.html">OsclSocketServ</a> *<a class="code" href="classOsclSocketServ.html#d0">NewL</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;alloc);
00061
00066 OSCL_IMPORT_REF <a class="code" href="classOsclSocketServ.html#a0">~OsclSocketServ</a>();
00067
00076 OSCL_IMPORT_REF int32 <a class="code" href="classOsclSocketServ.html#a1">Connect</a>(uint32 aMessageSlots = 8);
00077
00086 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclSocketServ.html#a2">Close</a>(<span class="keywordtype">bool</span> aCleanup = <span class="keyword">true</span>);
00087
00088 <span class="keyword">private</span>:
00089 <a class="code" href="classOsclSocketServ.html">OsclSocketServ</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;alloc): iServ(<a class="code" href="group__osclbase.html#a81">NULL</a>), iAlloc(alloc) {}
00090
00091 <a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *iServ;
00092 <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;iAlloc;
00093
<a name="l00094"></a><a class="code" href="classOsclSocketServ.html#l0">00094</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a>;
<a name="l00095"></a><a class="code" href="classOsclSocketServ.html#l1">00095</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclUDPSocket.html">OsclUDPSocket</a>;
<a name="l00096"></a><a class="code" href="classOsclSocketServ.html#l2">00096</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclDNS.html">OsclDNS</a>;
00097
00098 };
00099
00100
00101 <span class="keyword">class </span><a class="code" href="classOsclUDPSocketI.html">OsclUDPSocketI</a>;
00102
<a name="l00107"></a><a class="code" href="classOsclUDPSocket.html">00107</a> <span class="keyword">class </span><a class="code" href="classOsclUDPSocket.html">OsclUDPSocket</a> : <span class="keyword">public</span> <a class="code" href="classHeapBase.html">HeapBase</a>
00108 {
00109 <span class="keyword">public</span>:
00122 OSCL_IMPORT_REF <span class="keyword">static</span> <a class="code" href="classOsclUDPSocket.html">OsclUDPSocket</a> *<a class="code" href="classOsclUDPSocket.html#d0">NewL</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;alloc,
00123 <a class="code" href="classOsclSocketServ.html">OsclSocketServ</a>&amp; aServ,
00124 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
00125 uint32 aId);
00126
00131 OSCL_IMPORT_REF <a class="code" href="classOsclUDPSocket.html#a0">~OsclUDPSocket</a>();
00132
00145 OSCL_IMPORT_REF int32 <a class="code" href="classOsclUDPSocket.html#a1">Close</a>();
00146
00155 OSCL_IMPORT_REF int32 <a class="code" href="classOsclUDPSocket.html#a2">Bind</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress);
00156
00167 OSCL_IMPORT_REF int32 <a class="code" href="classOsclUDPSocket.html#a3">Join</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress);
00168
00182 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocket.html#a4">BindAsync</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress
00183 , int32 aTimeoutMsec = (-1));
00184
00193 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocket.html#a5">CancelBind</a>();
00194
00204 OSCL_IMPORT_REF uint8 *<a class="code" href="classOsclUDPSocket.html#a6">GetRecvData</a>(int32 *aLength);
00205
00215 OSCL_IMPORT_REF uint8 *<a class="code" href="classOsclUDPSocket.html#a7">GetSendData</a>(int32 *aLength);
00216
00232 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocket.html#a8">SendTo</a>(<span class="keyword">const</span> uint8* aPtr, uint32 aLen,
00233 <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
00234 int32 aTimeoutMsec = -1);
00243 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocket.html#a9">CancelSendTo</a>();
00244
00274 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclUDPSocket.html#a10">RecvFrom</a>(uint8* aPtr, uint32 aMaxLen,
00275 <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
00276 int32 aTimeoutMsec = -1,
00277 uint32 aMultiRecvLimit = 0,
00278 <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>,
00279 <a class="code" href="classOscl__Vector.html">Oscl_Vector&lt;OsclNetworkAddress, OsclMemAllocator&gt;</a>* aPacketSource = NULL);
00288 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocket.html#a11">CancelRecvFrom</a>();
00289
00299 OSCL_IMPORT_REF int32 <a class="code" href="classOsclUDPSocket.html#a12">SetRecvBufferSize</a>(uint32 size);
00300
00301 <span class="keyword">private</span>:
00302 <a class="code" href="classOsclUDPSocket.html">OsclUDPSocket</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;alloc): iUDPSocket(NULL), iAlloc(alloc) {}
00303 <a class="code" href="classOsclUDPSocketI.html">OsclUDPSocketI</a> *iUDPSocket;
00304 <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;iAlloc;
00305 };
00306
00307 <span class="keyword">class </span><a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a>;
00308
<a name="l00313"></a><a class="code" href="classOsclTCPSocket.html">00313</a> <span class="keyword">class </span><a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a> : <span class="keyword">public</span> <a class="code" href="classHeapBase.html">HeapBase</a>
00314 {
00315 <span class="keyword">public</span>:
00328 OSCL_IMPORT_REF <span class="keyword">static</span> <a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a> *<a class="code" href="classOsclTCPSocket.html#d0">NewL</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;alloc,
00329 <a class="code" href="classOsclSocketServ.html">OsclSocketServ</a>&amp; aServ,
00330 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver,
00331 uint32 aId);
00332
00337 OSCL_IMPORT_REF <a class="code" href="classOsclTCPSocket.html#a0">~OsclTCPSocket</a>();
00338
00339
00352 OSCL_IMPORT_REF int32 <a class="code" href="classOsclTCPSocket.html#a1">Close</a>();
00353
00362 OSCL_IMPORT_REF int32 <a class="code" href="classOsclTCPSocket.html#a2">Bind</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress);
00363
00377 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocket.html#a3">BindAsync</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress
00378 , int32 aTimeoutMsec = (-1));
00379
00388 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a4">CancelBind</a>();
00389
00398 OSCL_IMPORT_REF int32 <a class="code" href="classOsclTCPSocket.html#a5">Listen</a>(int32 aQueueSize);
00399
00413 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocket.html#a6">ListenAsync</a>(int32 aQueueSize, int32 aTimeoutMsec = (-1));
00414
00423 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a7">CancelListen</a>();
00424
00437 OSCL_IMPORT_REF <a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a> *<a class="code" href="classOsclTCPSocket.html#a8">GetAcceptedSocketL</a>(uint32 aId);
00438
00448 OSCL_IMPORT_REF uint8 *<a class="code" href="classOsclTCPSocket.html#a9">GetRecvData</a>(int32 *aLength);
00449
00459 OSCL_IMPORT_REF uint8 *<a class="code" href="classOsclTCPSocket.html#a10">GetSendData</a>(int32 *aLength);
00460
00474 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocket.html#a11">Connect</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>&amp; aAddress,
00475 int32 aTimeoutMsec = -1);
00476
00485 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a12">CancelConnect</a>();
00486
00500 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocket.html#a13">Shutdown</a>(<a class="code" href="oscl__socket__types_8h.html#a21">TPVSocketShutdown</a> aHow,
00501 int32 aTimeoutMsec = -1);
00502
00511 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a14">CancelShutdown</a>();
00512
00525 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocket.html#a15">Accept</a>(int32 aTimeout = -1);
00526
00535 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a16">CancelAccept</a>();
00536
00551 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocket.html#a17">Send</a>(<span class="keyword">const</span> uint8* aPtr, uint32 aLen,
00552 int32 aTimeoutMsec = -1);
00553
00562 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a18">CancelSend</a>();
00563
00578 OSCL_IMPORT_REF <a class="code" href="oscl__socket__types_8h.html#a20">TPVSocketEvent</a> <a class="code" href="classOsclTCPSocket.html#a19">Recv</a>(uint8* aPtr, uint32 aMaxLen,
00579 int32 aTimeoutMsec = -1);
00580
00589 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a20">CancelRecv</a>();
00590
00591 <span class="keyword">private</span>:
00592 <span class="keyword">static</span> <a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a> *<a class="code" href="classOsclTCPSocket.html#d0">NewL</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;alloc, <a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a>* aSocket);
00593
00594 <span class="keyword">private</span>:
00595 <a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;alloc): iTCPSocket(<a class="code" href="group__osclbase.html#a81">NULL</a>), iAlloc(alloc) {}
00596 <a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a> *iTCPSocket;
00597 <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &amp;iAlloc;
00598 };
00599
00600 <span class="preprocessor">#endif</span>
00601 <span class="preprocessor"></span>
00602
</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>