diff options
author | Erwin Nindl <nine@wirdorange.org> | 2007-10-07 22:07:03 +0000 |
---|---|---|
committer | Erwin Nindl <nine@wirdorange.org> | 2007-10-07 22:07:03 +0000 |
commit | 7763f07327f3abce839a690df46ced3bfd1d3d09 (patch) | |
tree | c80abe2cf8e137edba89cad9f14f63048275cee1 /doc/html/classSocket.html | |
parent | added doxygen, and doxygen makefile target (diff) |
added doxygen generatet documentation
Diffstat (limited to 'doc/html/classSocket.html')
-rw-r--r-- | doc/html/classSocket.html | 385 |
1 files changed, 385 insertions, 0 deletions
diff --git a/doc/html/classSocket.html b/doc/html/classSocket.html new file mode 100644 index 0000000..6d8d32e --- /dev/null +++ b/doc/html/classSocket.html @@ -0,0 +1,385 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>anytun: Socket Class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +<link href="tabs.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.1 --> +<div class="tabs"> + <ul> + <li><a href="main.html"><span>Main Page</span></a></li> + <li><a href="namespaces.html"><span>Namespaces</span></a></li> + <li id="current"><a href="annotated.html"><span>Classes</span></a></li> + <li><a href="files.html"><span>Files</span></a></li> + </ul></div> +<div class="tabs"> + <ul> + <li><a href="annotated.html"><span>Class List</span></a></li> + <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> + <li><a href="functions.html"><span>Class Members</span></a></li> + </ul></div> +<h1>Socket Class Reference</h1><!-- doxytag: class="Socket" --><code>#include <<a class="el" href="PracticalSocket_8h-source.html">PracticalSocket.h</a>></code> +<p> +<p>Inheritance diagram for Socket: +<p><center><img src="classSocket.png" usemap="#Socket_map" border="0" alt=""></center> +<map name="Socket_map"> +<area href="classCommunicatingSocket.html" alt="CommunicatingSocket" shape="rect" coords="72,56,207,80"> +<area href="classTCPServerSocket.html" alt="TCPServerSocket" shape="rect" coords="217,56,352,80"> +<area href="classTCPSocket.html" alt="TCPSocket" shape="rect" coords="0,112,135,136"> +<area href="classUDPSocket.html" alt="UDPSocket" shape="rect" coords="145,112,280,136"> +<area href="classUDPPacketSource.html" alt="UDPPacketSource" shape="rect" coords="145,168,280,192"> +</map> +<a href="classSocket-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#eac4eb6379a543d38ed88977d3b6630a">~Socket</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#0fca07bdfa97874fba1a17995ed7cda3">getLocalAddress</a> () throw (SocketException)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned short </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#e01143b667d69483a2f53d0f4ce7eeed">getLocalPort</a> () throw (SocketException)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#773fe4a35146002de76952e16fdebcfa">setLocalPort</a> (unsigned short localPort) throw (SocketException)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#a6b986410bc2e606ba27d01fa7cb8836">setLocalAddressAndPort</a> (const string &localAddress, unsigned short localPort=0) throw (SocketException)</td></tr> + +<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#c5060aeb501044044351d5a85b3fc95f">cleanUp</a> () throw (SocketException)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">static unsigned short </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#982c63b25c5b756321a74074a275adbc">resolveService</a> (const string &service, const string &protocol="tcp")</td></tr> + +<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#53e00027bab2125a2b407914c6148589">Socket</a> (int type, int protocol) throw (SocketException)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#6a2609eef6559336a595a336f138d395">Socket</a> (int <a class="el" href="classSocket.html#d5704d2fdfb062139e1f88831617bbfb">sockDesc</a>)</td></tr> + +<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#d5704d2fdfb062139e1f88831617bbfb">sockDesc</a></td></tr> + +<tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#656389d58fa00729ff70c4e159623f5c">Socket</a> (const <a class="el" href="classSocket.html">Socket</a> &sock)</td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classSocket.html#1ef8f4c222c32756c8b1537323702df8">operator=</a> (const <a class="el" href="classSocket.html">Socket</a> &sock)</td></tr> + +</table> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Base class representing basic communication endpoint +<p> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="eac4eb6379a543d38ed88977d3b6630a"></a><!-- doxytag: member="Socket::~Socket" ref="eac4eb6379a543d38ed88977d3b6630a" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">Socket::~Socket </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Close and deallocate this socket +</div> +</div><p> +<a class="anchor" name="656389d58fa00729ff70c4e159623f5c"></a><!-- doxytag: member="Socket::Socket" ref="656389d58fa00729ff70c4e159623f5c" args="(const Socket &sock)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">Socket::Socket </td> + <td>(</td> + <td class="paramtype">const <a class="el" href="classSocket.html">Socket</a> & </td> + <td class="paramname"> <em>sock</em> </td> + <td> ) </td> + <td width="100%"><code> [private]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="53e00027bab2125a2b407914c6148589"></a><!-- doxytag: member="Socket::Socket" ref="53e00027bab2125a2b407914c6148589" args="(int type, int protocol)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">Socket::Socket </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"> <em>type</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">int </td> + <td class="paramname"> <em>protocol</em></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> throw (<a class="el" href="classSocketException.html">SocketException</a>)<code> [protected]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<a class="anchor" name="6a2609eef6559336a595a336f138d395"></a><!-- doxytag: member="Socket::Socket" ref="6a2609eef6559336a595a336f138d395" args="(int sockDesc)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">Socket::Socket </td> + <td>(</td> + <td class="paramtype">int </td> + <td class="paramname"> <em>sockDesc</em> </td> + <td> ) </td> + <td width="100%"><code> [protected]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="0fca07bdfa97874fba1a17995ed7cda3"></a><!-- doxytag: member="Socket::getLocalAddress" ref="0fca07bdfa97874fba1a17995ed7cda3" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">string Socket::getLocalAddress </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classSocketException.html">SocketException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Get the local address <dl class="return" compact><dt><b>Returns:</b></dt><dd>local address of socket </dd></dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classSocketException.html">SocketException</a></em> </td><td>thrown if fetch fails </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="e01143b667d69483a2f53d0f4ce7eeed"></a><!-- doxytag: member="Socket::getLocalPort" ref="e01143b667d69483a2f53d0f4ce7eeed" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">unsigned short Socket::getLocalPort </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classSocketException.html">SocketException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Get the local port <dl class="return" compact><dt><b>Returns:</b></dt><dd>local port of socket </dd></dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classSocketException.html">SocketException</a></em> </td><td>thrown if fetch fails </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="773fe4a35146002de76952e16fdebcfa"></a><!-- doxytag: member="Socket::setLocalPort" ref="773fe4a35146002de76952e16fdebcfa" args="(unsigned short localPort)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Socket::setLocalPort </td> + <td>(</td> + <td class="paramtype">unsigned short </td> + <td class="paramname"> <em>localPort</em> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classSocketException.html">SocketException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Set the local port to the specified port and the local address to any interface <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>localPort</em> </td><td>local port </td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classSocketException.html">SocketException</a></em> </td><td>thrown if setting local port fails </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="a6b986410bc2e606ba27d01fa7cb8836"></a><!-- doxytag: member="Socket::setLocalAddressAndPort" ref="a6b986410bc2e606ba27d01fa7cb8836" args="(const string &localAddress, unsigned short localPort=0)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Socket::setLocalAddressAndPort </td> + <td>(</td> + <td class="paramtype">const string & </td> + <td class="paramname"> <em>localAddress</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">unsigned short </td> + <td class="paramname"> <em>localPort</em> = <code>0</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"> throw (<a class="el" href="classSocketException.html">SocketException</a>)</td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Set the local port to the specified port and the local address to the specified address. If you omit the port, a random port will be selected. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>localAddress</em> </td><td>local address </td></tr> + <tr><td valign="top"></td><td valign="top"><em>localPort</em> </td><td>local port </td></tr> + </table> +</dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classSocketException.html">SocketException</a></em> </td><td>thrown if setting local port or address fails </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="c5060aeb501044044351d5a85b3fc95f"></a><!-- doxytag: member="Socket::cleanUp" ref="c5060aeb501044044351d5a85b3fc95f" args="()" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Socket::cleanUp </td> + <td>(</td> + <td class="paramname"> </td> + <td> ) </td> + <td width="100%"> throw (<a class="el" href="classSocketException.html">SocketException</a>)<code> [static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +If WinSock, unload the WinSock DLLs; otherwise do nothing. We ignore this in our sample client code but include it in the library for completeness. If you are running on Windows and you are concerned about DLL resource consumption, call this after you are done with all <a class="el" href="classSocket.html">Socket</a> instances. If you execute this on Windows while some instance of <a class="el" href="classSocket.html">Socket</a> exists, you are toast. For portability of client code, this is an empty function on non-Windows platforms so you can always include it. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>buffer</em> </td><td>buffer to receive the data </td></tr> + <tr><td valign="top"></td><td valign="top"><em>bufferLen</em> </td><td>maximum number of bytes to read into buffer </td></tr> + </table> +</dl> +<dl class="return" compact><dt><b>Returns:</b></dt><dd>number of bytes read, 0 for EOF, and -1 for error </dd></dl> +<dl compact><dt><b>Exceptions:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classSocketException.html">SocketException</a></em> </td><td>thrown WinSock clean up fails </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="982c63b25c5b756321a74074a275adbc"></a><!-- doxytag: member="Socket::resolveService" ref="982c63b25c5b756321a74074a275adbc" args="(const string &service, const string &protocol="tcp")" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">unsigned short Socket::resolveService </td> + <td>(</td> + <td class="paramtype">const string & </td> + <td class="paramname"> <em>service</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const string & </td> + <td class="paramname"> <em>protocol</em> = <code>"tcp"</code></td><td> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td><td width="100%"><code> [static]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> +Resolve the specified service for the specified protocol to the corresponding port number in host byte order <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign="top"></td><td valign="top"><em>service</em> </td><td>service to resolve (e.g., "http") </td></tr> + <tr><td valign="top"></td><td valign="top"><em>protocol</em> </td><td>protocol of service to resolve. Default is "tcp". </td></tr> + </table> +</dl> + +</div> +</div><p> +<a class="anchor" name="1ef8f4c222c32756c8b1537323702df8"></a><!-- doxytag: member="Socket::operator=" ref="1ef8f4c222c32756c8b1537323702df8" args="(const Socket &sock)" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void Socket::operator= </td> + <td>(</td> + <td class="paramtype">const <a class="el" href="classSocket.html">Socket</a> & </td> + <td class="paramname"> <em>sock</em> </td> + <td> ) </td> + <td width="100%"><code> [private]</code></td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<hr><h2>Member Data Documentation</h2> +<a class="anchor" name="d5704d2fdfb062139e1f88831617bbfb"></a><!-- doxytag: member="Socket::sockDesc" ref="d5704d2fdfb062139e1f88831617bbfb" args="" --> +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int <a class="el" href="classSocket.html#d5704d2fdfb062139e1f88831617bbfb">Socket::sockDesc</a><code> [protected]</code> </td> + </tr> + </table> +</div> +<div class="memdoc"> + +<p> + +</div> +</div><p> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="PracticalSocket_8h-source.html">PracticalSocket.h</a><li><a class="el" href="PracticalSocket_8cpp.html">PracticalSocket.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Sun Oct 7 23:43:50 2007 for anytun by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address> +</body> +</html> |