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_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> <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> 9<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> 1000002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 1100003 1200004 <span class="comment">// O S C L _ S O C K E T</span> 1300005 1400006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 1500007 1600018 <span class="preprocessor">#ifndef OSCL_SOCKET_H_INCLUDED</span> 1700019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_SOCKET_H_INCLUDED</span> 1800020 <span class="preprocessor"></span> 1900021 <span class="preprocessor">#ifndef OSCLCONFIG_IO_H_INCLUDED</span> 2000022 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="osclconfig__io_8h.html">osclconfig_io.h</a>"</span> 2100023 <span class="preprocessor">#endif</span> 2200024 <span class="preprocessor"></span> 2300025 <span class="preprocessor">#ifndef OSCL_SOCKET_TYPES_H_INCLUDED</span> 2400026 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__socket__types_8h.html">oscl_socket_types.h</a>"</span> 2500027 <span class="preprocessor">#endif</span> 2600028 <span class="preprocessor"></span> 2700029 <span class="preprocessor">#ifndef OSCL_HEAPBASE_H_INCLUDED</span> 2800030 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__heapbase_8h.html">oscl_heapbase.h</a>"</span> 2900031 <span class="preprocessor">#endif</span> 3000032 <span class="preprocessor"></span> 3100033 <span class="preprocessor">#ifndef OSCL_DEFALLOC_H_INCLUDED</span> 3200034 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__defalloc_8h.html">oscl_defalloc.h</a>"</span> 3300035 <span class="preprocessor">#endif</span> 3400036 <span class="preprocessor"></span> 3500037 <span class="preprocessor">#ifndef OSCL_VECTOR_H_INCLUDED</span> 3600038 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__vector_8h.html">oscl_vector.h</a>"</span> 3700039 <span class="preprocessor">#endif</span> 3800040 <span class="preprocessor"></span> 3900041 <span class="preprocessor">#ifndef OSCL_MEM_H_INCLUDED</span> 4000042 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mem_8h.html">oscl_mem.h</a>"</span> 4100043 <span class="preprocessor">#endif</span> 4200044 <span class="preprocessor"></span> 4300048 <span class="keyword">class </span><a class="code" href="classOsclSocketServI.html">OsclSocketServI</a>; 4400049 45<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> 4600051 { 4700052 <span class="keyword">public</span>: 4800060 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> &alloc); 4900061 5000066 OSCL_IMPORT_REF <a class="code" href="classOsclSocketServ.html#a0">~OsclSocketServ</a>(); 5100067 5200076 OSCL_IMPORT_REF int32 <a class="code" href="classOsclSocketServ.html#a1">Connect</a>(uint32 aMessageSlots = 8); 5300077 5400086 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>); 5500087 5600088 <span class="keyword">private</span>: 5700089 <a class="code" href="classOsclSocketServ.html">OsclSocketServ</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &alloc): iServ(<a class="code" href="group__osclbase.html#a81">NULL</a>), iAlloc(alloc) {} 5800090 5900091 <a class="code" href="classOsclSocketServI.html">OsclSocketServI</a> *iServ; 6000092 <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &iAlloc; 6100093 62<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>; 63<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>; 64<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>; 6500097 6600098 }; 6700099 6800100 6900101 <span class="keyword">class </span><a class="code" href="classOsclUDPSocketI.html">OsclUDPSocketI</a>; 7000102 71<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> 7200108 { 7300109 <span class="keyword">public</span>: 7400122 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> &alloc, 7500123 <a class="code" href="classOsclSocketServ.html">OsclSocketServ</a>& aServ, 7600124 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver, 7700125 uint32 aId); 7800126 7900131 OSCL_IMPORT_REF <a class="code" href="classOsclUDPSocket.html#a0">~OsclUDPSocket</a>(); 8000132 8100145 OSCL_IMPORT_REF int32 <a class="code" href="classOsclUDPSocket.html#a1">Close</a>(); 8200146 8300155 OSCL_IMPORT_REF int32 <a class="code" href="classOsclUDPSocket.html#a2">Bind</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress); 8400156 8500167 OSCL_IMPORT_REF int32 <a class="code" href="classOsclUDPSocket.html#a3">Join</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress); 8600168 8700182 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>& aAddress 8800183 , int32 aTimeoutMsec = (-1)); 8900184 9000193 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocket.html#a5">CancelBind</a>(); 9100194 9200204 OSCL_IMPORT_REF uint8 *<a class="code" href="classOsclUDPSocket.html#a6">GetRecvData</a>(int32 *aLength); 9300205 9400215 OSCL_IMPORT_REF uint8 *<a class="code" href="classOsclUDPSocket.html#a7">GetSendData</a>(int32 *aLength); 9500216 9600232 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, 9700233 <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress, 9800234 int32 aTimeoutMsec = -1); 9900243 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocket.html#a9">CancelSendTo</a>(); 10000244 10100274 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, 10200275 <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress, 10300276 int32 aTimeoutMsec = -1, 10400277 uint32 aMultiRecvLimit = 0, 10500278 <a class="code" href="classOscl__Vector.html">Oscl_Vector<uint32, OsclMemAllocator></a>* aPacketLen = <a class="code" href="group__osclbase.html#a81">NULL</a>, 10600279 <a class="code" href="classOscl__Vector.html">Oscl_Vector<OsclNetworkAddress, OsclMemAllocator></a>* aPacketSource = NULL); 10700288 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclUDPSocket.html#a11">CancelRecvFrom</a>(); 10800289 10900299 OSCL_IMPORT_REF int32 <a class="code" href="classOsclUDPSocket.html#a12">SetRecvBufferSize</a>(uint32 size); 11000300 11100301 <span class="keyword">private</span>: 11200302 <a class="code" href="classOsclUDPSocket.html">OsclUDPSocket</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &alloc): iUDPSocket(NULL), iAlloc(alloc) {} 11300303 <a class="code" href="classOsclUDPSocketI.html">OsclUDPSocketI</a> *iUDPSocket; 11400304 <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &iAlloc; 11500305 }; 11600306 11700307 <span class="keyword">class </span><a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a>; 11800308 119<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> 12000314 { 12100315 <span class="keyword">public</span>: 12200328 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> &alloc, 12300329 <a class="code" href="classOsclSocketServ.html">OsclSocketServ</a>& aServ, 12400330 <a class="code" href="classOsclSocketObserver.html">OsclSocketObserver</a> *aObserver, 12500331 uint32 aId); 12600332 12700337 OSCL_IMPORT_REF <a class="code" href="classOsclTCPSocket.html#a0">~OsclTCPSocket</a>(); 12800338 12900339 13000352 OSCL_IMPORT_REF int32 <a class="code" href="classOsclTCPSocket.html#a1">Close</a>(); 13100353 13200362 OSCL_IMPORT_REF int32 <a class="code" href="classOsclTCPSocket.html#a2">Bind</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& aAddress); 13300363 13400377 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>& aAddress 13500378 , int32 aTimeoutMsec = (-1)); 13600379 13700388 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a4">CancelBind</a>(); 13800389 13900398 OSCL_IMPORT_REF int32 <a class="code" href="classOsclTCPSocket.html#a5">Listen</a>(int32 aQueueSize); 14000399 14100413 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)); 14200414 14300423 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a7">CancelListen</a>(); 14400424 14500437 OSCL_IMPORT_REF <a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a> *<a class="code" href="classOsclTCPSocket.html#a8">GetAcceptedSocketL</a>(uint32 aId); 14600438 14700448 OSCL_IMPORT_REF uint8 *<a class="code" href="classOsclTCPSocket.html#a9">GetRecvData</a>(int32 *aLength); 14800449 14900459 OSCL_IMPORT_REF uint8 *<a class="code" href="classOsclTCPSocket.html#a10">GetSendData</a>(int32 *aLength); 15000460 15100474 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>& aAddress, 15200475 int32 aTimeoutMsec = -1); 15300476 15400485 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a12">CancelConnect</a>(); 15500486 15600500 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, 15700501 int32 aTimeoutMsec = -1); 15800502 15900511 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a14">CancelShutdown</a>(); 16000512 16100525 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); 16200526 16300535 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a16">CancelAccept</a>(); 16400536 16500551 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, 16600552 int32 aTimeoutMsec = -1); 16700553 16800562 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a18">CancelSend</a>(); 16900563 17000578 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, 17100579 int32 aTimeoutMsec = -1); 17200580 17300589 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classOsclTCPSocket.html#a20">CancelRecv</a>(); 17400590 17500591 <span class="keyword">private</span>: 17600592 <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> &alloc, <a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a>* aSocket); 17700593 17800594 <span class="keyword">private</span>: 17900595 <a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &alloc): iTCPSocket(<a class="code" href="group__osclbase.html#a81">NULL</a>), iAlloc(alloc) {} 18000596 <a class="code" href="classOsclTCPSocketI.html">OsclTCPSocketI</a> *iTCPSocket; 18100597 <a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &iAlloc; 18200598 }; 18300599 18400600 <span class="preprocessor">#endif</span> 18500601 <span class="preprocessor"></span> 18600602 187</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> 188<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> 189</small></address> 190</body> 191</html> 192