📄 ipxsock_8h-source.html
字号:
<!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>ipxsock.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="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>ipxsock.h</h1><a href="ipxsock_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span>00002 <span class="comment"> * ipxsock.h</span>00003 <span class="comment"> *</span>00004 <span class="comment"> * IPX protocol socket I/O channel class.</span>00005 <span class="comment"> *</span>00006 <span class="comment"> * Portable Windows Library</span>00007 <span class="comment"> *</span>00008 <span class="comment"> * Copyright (c) 1993-1998 Equivalence Pty. Ltd.</span>00009 <span class="comment"> *</span>00010 <span class="comment"> * The contents of this file are subject to the Mozilla Public License</span>00011 <span class="comment"> * Version 1.0 (the "License"); you may not use this file except in</span>00012 <span class="comment"> * compliance with the License. You may obtain a copy of the License at</span>00013 <span class="comment"> * http://www.mozilla.org/MPL/</span>00014 <span class="comment"> *</span>00015 <span class="comment"> * Software distributed under the License is distributed on an "AS IS"</span>00016 <span class="comment"> * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See</span>00017 <span class="comment"> * the License for the specific language governing rights and limitations</span>00018 <span class="comment"> * under the License.</span>00019 <span class="comment"> *</span>00020 <span class="comment"> * The Original Code is Portable Windows Library.</span>00021 <span class="comment"> *</span>00022 <span class="comment"> * The Initial Developer of the Original Code is Equivalence Pty. Ltd.</span>00023 <span class="comment"> *</span>00024 <span class="comment"> * Portions are Copyright (C) 1993 Free Software Foundation, Inc.</span>00025 <span class="comment"> * All Rights Reserved.</span>00026 <span class="comment"> *</span>00027 <span class="comment"> * Contributor(s): ______________________________________.</span>00028 <span class="comment"> *</span>00029 <span class="comment"> * $Log: ipxsock.h,v $</span>00030 <span class="comment"> * Revision 1.11 2003/09/17 05:41:58 csoutheren</span>00031 <span class="comment"> * Removed recursive includes</span>00032 <span class="comment"> *</span>00033 <span class="comment"> * Revision 1.10 2003/09/17 01:18:02 csoutheren</span>00034 <span class="comment"> * Removed recursive include file system and removed all references</span>00035 <span class="comment"> * to deprecated coooperative threading support</span>00036 <span class="comment"> *</span>00037 <span class="comment"> * Revision 1.9 2002/09/16 01:08:59 robertj</span>00038 <span class="comment"> * Added #define so can select if #pragma interface/implementation is used on</span>00039 <span class="comment"> * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.</span>00040 <span class="comment"> *</span>00041 <span class="comment"> * Revision 1.8 2001/05/22 12:49:32 robertj</span>00042 <span class="comment"> * Did some seriously wierd rewrite of platform headers to eliminate the</span>00043 <span class="comment"> * stupid GNU compiler warning about braces not matching.</span>00044 <span class="comment"> *</span>00045 <span class="comment"> * Revision 1.7 1999/03/09 02:59:50 robertj</span>00046 <span class="comment"> * Changed comments to doc++ compatible documentation.</span>00047 <span class="comment"> *</span>00048 <span class="comment"> * Revision 1.6 1999/02/16 08:12:00 robertj</span>00049 <span class="comment"> * MSVC 6.0 compatibility changes.</span>00050 <span class="comment"> *</span>00051 <span class="comment"> * Revision 1.5 1998/11/30 02:50:58 robertj</span>00052 <span class="comment"> * New directory structure</span>00053 <span class="comment"> *</span>00054 <span class="comment"> * Revision 1.4 1998/09/23 06:20:47 robertj</span>00055 <span class="comment"> * Added open source copyright license.</span>00056 <span class="comment"> *</span>00057 <span class="comment"> * Revision 1.3 1996/10/08 13:21:04 robertj</span>00058 <span class="comment"> * More IPX implementation.</span>00059 <span class="comment"> *</span>00060 <span class="comment"> * Revision 1.1 1996/09/14 13:00:56 robertj</span>00061 <span class="comment"> * Initial revision</span>00062 <span class="comment"> *</span>00063 <span class="comment"> */</span>00064 00065 <span class="preprocessor">#ifndef _PIPXSOCKET</span>00066 <span class="preprocessor"></span><span class="preprocessor">#define _PIPXSOCKET</span>00067 <span class="preprocessor"></span>00068 <span class="preprocessor">#ifdef P_USE_PRAGMA</span>00069 <span class="preprocessor"></span><span class="preprocessor">#pragma interface</span>00070 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00071 <span class="preprocessor"></span>00072 <span class="preprocessor">#include <<a class="code" href="socket_8h.html">ptlib/socket.h</a>></span>00073 00074 <a name="l00078"></a><a class="code" href="classPIPXSocket.html">00078</a> <span class="keyword">class </span><a class="code" href="classPIPXSocket.html">PIPXSocket</a> : <span class="keyword">public</span> <a class="code" href="classPSocket.html">PSocket</a>00079 {00080 <a class="code" href="object_8h.html#a27">PCLASSINFO</a>(<a class="code" href="classPIPXSocket.html">PIPXSocket</a>, <a class="code" href="classPSocket.html">PSocket</a>);00081 00082 <span class="keyword">public</span>:00085 <a class="code" href="classPIPXSocket.html#a0">PIPXSocket</a>(00086 WORD <a class="code" href="classPSocket.html#n0">port</a> = 0 00087 );00088 00089 00090 <span class="keyword">public</span>:<a name="l00093"></a><a class="code" href="classPIPXSocket_1_1Address.html">00093</a> <span class="keyword">class </span><a class="code" href="classPIPXSocket_1_1Address.html">Address</a> {00094 <span class="keyword">public</span>:00095 <span class="keyword">union </span>{00096 <span class="keyword">struct </span>{<a name="l00097"></a><a class="code" href="classPIPXSocket_1_1Address.html#m3">00097</a> BYTE <a class="code" href="classPIPXSocket_1_1Address.html#m0">b1</a>,<a class="code" href="classPIPXSocket_1_1Address.html#m1">b2</a>,<a class="code" href="classPIPXSocket_1_1Address.html#m2">b3</a>,<a class="code" href="classPIPXSocket_1_1Address.html#m3">b4</a>;00098 } <a class="code" href="classPIPXSocket_1_1Address.html#m4">b</a>;00099 <span class="keyword">struct </span>{<a name="l00100"></a><a class="code" href="classPIPXSocket_1_1Address.html#m5">00100</a> WORD <a class="code" href="classPIPXSocket_1_1Address.html#m5">w1</a>,<a class="code" href="classPIPXSocket_1_1Address.html#m6">s_w2</a>;00101 } <a class="code" href="classPIPXSocket_1_1Address.html#m7">w</a>;<a name="l00102"></a><a class="code" href="classPIPXSocket_1_1Address.html#m8">00102</a> DWORD <a class="code" href="classPIPXSocket_1_1Address.html#m8">dw</a>;00103 } <a class="code" href="classPIPXSocket_1_1Address.html#m9">network</a>;<a name="l00104"></a><a class="code" href="classPIPXSocket_1_1Address.html#m10">00104</a> BYTE <a class="code" href="classPIPXSocket_1_1Address.html#m10">node</a>[6];00105 00107 <a class="code" href="classPIPXSocket_1_1Address.html#a0">Address</a>();00109 <a class="code" href="classPIPXSocket_1_1Address.html#a0">Address</a>(<span class="keyword">const</span> <a class="code" href="classPIPXSocket_1_1Address.html">Address</a> & addr );00111 <a class="code" href="classPIPXSocket_1_1Address.html#a0">Address</a>(<span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & str );00113 <a class="code" href="classPIPXSocket_1_1Address.html#a0">Address</a>(00114 DWORD netNum, 00115 <span class="keyword">const</span> <span class="keywordtype">char</span> * nodeNum 00116 );00118 <a class="code" href="classPIPXSocket_1_1Address.html">Address</a> & <a class="code" href="classPIPXSocket_1_1Address.html#a4">operator=</a>(<span class="keyword">const</span> <a class="code" href="classPIPXSocket_1_1Address.html">Address</a> & addr );00120 <a class="code" href="classPIPXSocket_1_1Address.html#a5">operator PString</a>() <span class="keyword">const</span>;00125 BOOL <a class="code" href="classPIPXSocket_1_1Address.html#a6">IsValid</a>() <span class="keyword">const</span>;<a name="l00127"></a><a class="code" href="classPIPXSocket_1_1Address.html#l0">00127</a> <span class="keyword">friend</span> ostream & <a class="code" href="classPIPXSocket_1_1Address.html#l0">operator<<</a>(00128 ostream & strm, 00129 <a class="code" href="classPIPXSocket_1_1Address.html">Address</a> & addr 00130 ) { <span class="keywordflow">return</span> strm << (PString)addr; }00131 };00132 00143 <span class="keyword">virtual</span> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIPXSocket.html#z163_0">GetName</a>() <span class="keyword">const</span>;00145 00146 00161 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPXSocket.html#z165_0">Connect</a>(00162 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & address 00163 );00176 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPXSocket.html#z165_0">Connect</a>(00177 <span class="keyword">const</span> Address & address 00178 );00179 00195 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPXSocket.html#z165_2">Listen</a>(00196 <span class="keywordtype">unsigned</span> queueSize = 5, 00197 WORD <a class="code" href="classPSocket.html#n0">port</a> = 0, 00198 <a class="code" href="classPSocket.html#z369_0">Reusability</a> reuse = <a class="code" href="classPSocket.html#z369_0s1">AddressIsExclusive</a> 00199 );00201 00209 <span class="keyword">static</span> <a class="code" href="classPString.html">PString</a> <a class="code" href="classPIPXSocket.html#z167_4">GetHostName</a>(00210 <span class="keyword">const</span> Address & addr 00211 );00212 00218 <span class="keyword">static</span> BOOL <a class="code" href="classPIPXSocket.html#z167_5">GetHostAddress</a>(00219 Address & addr 00220 );00221 00227 <span class="keyword">static</span> BOOL <a class="code" href="classPIPXSocket.html#z167_5">GetHostAddress</a>(00228 <span class="keyword">const</span> <a class="code" href="classPString.html">PString</a> & hostname,00232 Address & addr 00233 );00234 00240 BOOL <a class="code" href="classPIPXSocket.html#z167_0">GetLocalAddress</a>(00241 Address & addr 00242 );00243 00249 BOOL <a class="code" href="classPIPXSocket.html#z167_0">GetLocalAddress</a>(00250 Address & addr, 00251 WORD & <a class="code" href="classPSocket.html#n0">port</a> 00252 );00253 00260 BOOL <a class="code" href="classPIPXSocket.html#z167_2">GetPeerAddress</a>(00261 Address & addr 00262 );00263 00270 BOOL <a class="code" href="classPIPXSocket.html#z167_2">GetPeerAddress</a>(00271 Address & addr, 00272 WORD & <a class="code" href="classPSocket.html#n0">port</a> 00273 );00275 00283 BOOL <a class="code" href="classPIPXSocket.html#z169_0">SetPacketType</a>(00284 <span class="keywordtype">int</span> type 00285 );00286 00292 <span class="keywordtype">int</span> <a class="code" href="classPIPXSocket.html#z169_1">GetPacketType</a>();00293 00294 00300 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPXSocket.html#z169_2">ReadFrom</a>(00301 <span class="keywordtype">void</span> * buf, 00302 PINDEX len, 00303 Address & addr, 00304 WORD & <a class="code" href="classPSocket.html#n0">port</a> 00305 );00306 00312 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPXSocket.html#z169_3">WriteTo</a>(00313 <span class="keyword">const</span> <span class="keywordtype">void</span> * buf, 00314 PINDEX len, 00315 <span class="keyword">const</span> Address & addr, 00316 WORD <a class="code" href="classPSocket.html#n0">port</a> 00317 );00319 00320 00321 <span class="keyword">protected</span>:00322 <span class="keyword">virtual</span> BOOL <a class="code" href="classPIPXSocket.html#b0">OpenSocket</a>();00323 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * <a class="code" href="classPIPXSocket.html#b1">GetProtocolName</a>() <span class="keyword">const</span>;00324 00325 00326 <span class="comment">// Include platform dependent part of class</span>00327 <span class="preprocessor">#ifdef _WIN32</span>00328 <span class="preprocessor"></span><span class="preprocessor">#include "msos/ptlib/ipxsock.h"</span>00329 <span class="preprocessor">#else</span>00330 <span class="preprocessor"></span><span class="preprocessor">#include "unix/ptlib/ipxsock.h"</span>00331 <span class="preprocessor">#endif</span>00332 <span class="preprocessor"></span>};00333 00334 <span class="preprocessor">#endif</span>00335 <span class="preprocessor"></span>00336 <span class="comment">// End Of File ///////////////////////////////////////////////////////////////</span></pre></div><hr><address style="align: right;"><small>Generated on Wed Sep 29 22:44:11 2004 for PWLib by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.18 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -