| <!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_imp_pv.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_socket_imp_pv.h</h1><a href="oscl__socket__imp__pv_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 |
| 00002 |
| 00003 <span class="preprocessor">#ifndef OSCL_SOCKET_IMP_PV_H_INCLUDED</span> |
| 00004 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_SOCKET_IMP_PV_H_INCLUDED</span> |
| 00005 <span class="preprocessor"></span> |
| 00006 <span class="preprocessor">#include "<a class="code" href="oscl__socket__imp__base_8h.html">oscl_socket_imp_base.h</a>"</span> |
| 00007 |
| <a name="l00015"></a><a class="code" href="oscl__socket__imp__pv_8h.html#a0">00015</a> <span class="preprocessor">#define PVSOCK_ERR_BAD_PARAM (-1)</span> |
| <a name="l00016"></a><a class="code" href="oscl__socket__imp__pv_8h.html#a1">00016</a> <span class="preprocessor"></span><span class="preprocessor">#define PVSOCK_ERR_SOCK_NOT_OPEN (-2)</span> |
| <a name="l00017"></a><a class="code" href="oscl__socket__imp__pv_8h.html#a2">00017</a> <span class="preprocessor"></span><span class="preprocessor">#define PVSOCK_ERR_SOCK_NO_SERV (-3)</span> |
| <a name="l00018"></a><a class="code" href="oscl__socket__imp__pv_8h.html#a3">00018</a> <span class="preprocessor"></span><span class="preprocessor">#define PVSOCK_ERR_SERV_NOT_CONNECTED (-4)</span> |
| <a name="l00019"></a><a class="code" href="oscl__socket__imp__pv_8h.html#a4">00019</a> <span class="preprocessor"></span><span class="preprocessor">#define PVSOCK_ERR_SOCK_NOT_CONNECTED (-5)</span> |
| <a name="l00020"></a><a class="code" href="oscl__socket__imp__pv_8h.html#a5">00020</a> <span class="preprocessor"></span><span class="preprocessor">#define PVSOCK_ERR_NOT_IMPLEMENTED (-6)</span> |
| 00021 <span class="preprocessor"></span> |
| 00022 |
| 00023 <span class="keyword">class </span><a class="code" href="classOsclSocketServI.html">OsclSocketServI</a>; |
| 00024 <span class="keyword">class </span><a class="code" href="classPVLogger.html">PVLogger</a>; |
| 00025 <span class="keyword">class </span><a class="code" href="classOsclSocketServRequestQElem.html">OsclSocketServRequestQElem</a>; |
| 00026 |
| <a name="l00029"></a><a class="code" href="classOsclSocketI.html">00029</a> <span class="keyword">class </span><a class="code" href="classOsclSocketI.html">OsclSocketI</a>: <span class="keyword">public</span> <a class="code" href="classOsclSocketIBase.html">OsclSocketIBase</a> |
| 00030 { |
| 00031 <span class="keyword">public</span>: |
| 00032 <span class="keyword">static</span> <a class="code" href="classOsclSocketI.html">OsclSocketI</a>* <a class="code" href="classOsclSocketI.html#d0">NewL</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &a); |
| 00033 <a class="code" href="classOsclSocketI.html#a0">~OsclSocketI</a>(); |
| 00034 |
| 00035 <span class="comment">//synchronous methods</span> |
| 00036 int32 <a class="code" href="classOsclSocketI.html#a1">Open</a>(<a class="code" href="classOsclSocketServI.html">OsclSocketServI</a>& aServer, uint32 addrFamily, uint32 sockType, uint32 protocol); |
| 00037 int32 <a class="code" href="classOsclSocketI.html#a1">Open</a>(<a class="code" href="classOsclSocketServI.html">OsclSocketServI</a>& aServer); |
| 00038 int32 <a class="code" href="classOsclSocketI.html#a3">Bind</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& anAddr); |
| 00039 int32 <a class="code" href="classOsclSocketI.html#a4">Join</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& anAddr); |
| 00040 int32 <a class="code" href="classOsclSocketI.html#a5">Close</a>(); |
| 00041 int32 <a class="code" href="classOsclSocketI.html#a6">Listen</a>(uint32 qSize); |
| 00042 int32 <a class="code" href="classOsclSocketI.html#a7">SetRecvBufferSize</a>(uint32 size); |
| 00043 |
| 00044 <span class="comment">//asynchronous methods.</span> |
| 00045 |
| 00046 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a8">Connect</a>(<a class="code" href="classConnectParam.html">ConnectParam</a>& , <a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>&); |
| 00047 |
| 00048 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a9">Accept</a>(<a class="code" href="classAcceptParam.html">AcceptParam</a> &, <a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>&); |
| 00049 |
| 00050 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a10">Shutdown</a>(<a class="code" href="classShutdownParam.html">ShutdownParam</a> &, <a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>&); |
| 00051 |
| 00052 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a11">Send</a>(<a class="code" href="classSendParam.html">SendParam</a> &, <a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>&); |
| 00053 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a12">SendSuccess</a>(<a class="code" href="classSendParam.html">SendParam</a> &); |
| 00054 |
| 00055 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a13">SendTo</a>(<a class="code" href="classSendToParam.html">SendToParam</a> & , <a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>&); |
| 00056 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a14">SendToSuccess</a>(<a class="code" href="classSendToParam.html">SendToParam</a> &); |
| 00057 |
| 00058 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a15">Recv</a>(<a class="code" href="classRecvParam.html">RecvParam</a> &, <a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>&); |
| 00059 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a16">RecvSuccess</a>(<a class="code" href="classRecvParam.html">RecvParam</a> &); |
| 00060 |
| 00061 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a17">RecvFrom</a>(<a class="code" href="classRecvFromParam.html">RecvFromParam</a> &, <a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>&); |
| 00062 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a18">RecvFromSuccess</a>(<a class="code" href="classRecvFromParam.html">RecvFromParam</a> &); |
| 00063 |
| 00064 |
| 00065 <span class="keyword">private</span>: |
| 00066 <a class="code" href="classOsclSocketI.html">OsclSocketI</a>(<a class="code" href="classOscl__DefAlloc.html">Oscl_DefAlloc</a> &a); |
| 00067 |
| 00068 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclSocketIBase.html#b1">CancelConnect</a>(); |
| 00069 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclSocketIBase.html#b2">CancelAccept</a>(); |
| 00070 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclSocketIBase.html#b3">CancelShutdown</a>(); |
| 00071 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclSocketIBase.html#b4">CancelSend</a>(); |
| 00072 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclSocketIBase.html#b5">CancelSendTo</a>(); |
| 00073 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclSocketIBase.html#b6">CancelRecv</a>(); |
| 00074 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classOsclSocketIBase.html#b7">CancelRecvFrom</a>(); |
| 00075 |
| 00076 <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classOsclSocketIBase.html#b10">IsOpen</a>(); |
| 00077 |
| 00078 |
| 00079 |
| 00080 <span class="comment">//PV socket server</span> |
| 00081 |
| 00082 <span class="comment">//the OS-level socket</span> |
| 00083 <a class="code" href="osclconfig__io_8h.html#a44">TOsclSocket</a> iSocket; |
| 00084 |
| 00085 <span class="keyword">public</span>: |
| <a name="l00086"></a><a class="code" href="classOsclSocketI.html#a19">00086</a> <a class="code" href="osclconfig__io_8h.html#a44">TOsclSocket</a> <a class="code" href="classOsclSocketI.html#a19">Socket</a>() |
| 00087 { |
| 00088 <span class="keywordflow">return</span> iSocket; |
| 00089 } |
| 00090 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classOsclSocketI.html#d1">MakeAddr</a>(<a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& in, <a class="code" href="osclconfig__io_8h.html#a45">TOsclSockAddr</a>& addr); |
| 00091 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#d1">MakeAddr</a>(<a class="code" href="osclconfig__io_8h.html#a45">TOsclSockAddr</a>& in, <a class="code" href="classOsclNetworkAddress.html">OsclNetworkAddress</a>& addr); |
| 00092 |
| 00093 <span class="comment">//routines to handle each type of socket request under the</span> |
| 00094 <span class="comment">//server thread.</span> |
| 00095 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a20">ProcessConnect</a>(<a class="code" href="classOsclSocketServRequestQElem.html">OsclSocketServRequestQElem</a>*); |
| 00096 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a21">ProcessShutdown</a>(<a class="code" href="classOsclSocketServRequestQElem.html">OsclSocketServRequestQElem</a>*); |
| 00097 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a22">ProcessAccept</a>(<a class="code" href="classOsclSocketServRequestQElem.html">OsclSocketServRequestQElem</a>*); |
| 00098 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a23">ProcessSendTo</a>(<a class="code" href="classOsclSocketServRequestQElem.html">OsclSocketServRequestQElem</a>*); |
| 00099 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a24">ProcessRecvFrom</a>(<a class="code" href="classOsclSocketServRequestQElem.html">OsclSocketServRequestQElem</a>*); |
| 00100 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a25">ProcessSend</a>(<a class="code" href="classOsclSocketServRequestQElem.html">OsclSocketServRequestQElem</a>*); |
| 00101 <span class="keywordtype">void</span> <a class="code" href="classOsclSocketI.html#a26">ProcessRecv</a>(<a class="code" href="classOsclSocketServRequestQElem.html">OsclSocketServRequestQElem</a>*); |
| 00102 |
| 00103 <span class="keyword">private</span>: |
| 00104 <span class="keywordtype">bool</span> iSocketValid; |
| 00105 <span class="keywordtype">bool</span> iSocketConnected; |
| 00106 <span class="keywordtype">void</span> InitSocket(<span class="keywordtype">bool</span> valid); |
| 00107 |
| 00108 <span class="keywordtype">bool</span> IsConnected(<a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>& aObject); |
| 00109 <span class="keywordtype">bool</span> IsReady(<a class="code" href="classOsclSocketRequestAO.html">OsclSocketRequestAO</a>& aObject); |
| 00110 |
| 00111 <span class="comment">//server requests</span> |
| 00112 <a class="code" href="classOsclSocketRequest.html">OsclSocketRequest</a> iSockServAcceptRequest; |
| 00113 <a class="code" href="classOsclSocketRequest.html">OsclSocketRequest</a> iSockServConnectRequest; |
| 00114 <a class="code" href="classOsclSocketRequest.html">OsclSocketRequest</a> iSockServRecvRequest; |
| 00115 <a class="code" href="classOsclSocketRequest.html">OsclSocketRequest</a> iSockServRecvFromRequest; |
| 00116 <a class="code" href="classOsclSocketRequest.html">OsclSocketRequest</a> iSockServSendRequest; |
| 00117 <a class="code" href="classOsclSocketRequest.html">OsclSocketRequest</a> iSockServSendToRequest; |
| 00118 <a class="code" href="classOsclSocketRequest.html">OsclSocketRequest</a> iSockServShutdownRequest; |
| <a name="l00119"></a><a class="code" href="classOsclSocketI.html#l0">00119</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclAcceptRequest.html">OsclAcceptRequest</a>; |
| <a name="l00120"></a><a class="code" href="classOsclSocketI.html#l1">00120</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclConnectRequest.html">OsclConnectRequest</a>; |
| <a name="l00121"></a><a class="code" href="classOsclSocketI.html#l2">00121</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclRecvRequest.html">OsclRecvRequest</a>; |
| <a name="l00122"></a><a class="code" href="classOsclSocketI.html#l3">00122</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclRecvFromRequest.html">OsclRecvFromRequest</a>; |
| <a name="l00123"></a><a class="code" href="classOsclSocketI.html#l4">00123</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclSendRequest.html">OsclSendRequest</a>; |
| <a name="l00124"></a><a class="code" href="classOsclSocketI.html#l5">00124</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclSendToRequest.html">OsclSendToRequest</a>; |
| <a name="l00125"></a><a class="code" href="classOsclSocketI.html#l6">00125</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclShutdownRequest.html">OsclShutdownRequest</a>; |
| 00126 |
| <a name="l00127"></a><a class="code" href="classOsclSocketI.html#l7">00127</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclUDPSocket.html">OsclUDPSocket</a>; |
| <a name="l00128"></a><a class="code" href="classOsclSocketI.html#l8">00128</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclTCPSocket.html">OsclTCPSocket</a>; |
| 00129 |
| 00130 <a class="code" href="classPVLogger.html">PVLogger</a>* iLogger; |
| 00131 |
| 00132 <span class="keyword">public</span>: |
| 00133 <span class="comment">//for logging in socket request list.</span> |
| <a name="l00134"></a><a class="code" href="classOsclSocketI.html#a27">00134</a> <a class="code" href="classPVLogger.html">PVLogger</a>* <a class="code" href="classOsclSocketI.html#a27">Logger</a>() |
| 00135 { |
| 00136 <span class="keywordflow">return</span> iLogger; |
| 00137 } |
| 00138 |
| 00139 }; |
| 00140 |
| 00141 <span class="preprocessor">#endif</span> |
| 00142 <span class="preprocessor"></span> |
| 00143 |
| 00144 |
| 00145 |
| </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> |