summaryrefslogtreecommitdiff
path: root/doc/html/classTCPServerSocket.html
blob: 6dcb6dc9b67025ebe80be3025cbf85d88c3cf988 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!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: TCPServerSocket 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&nbsp;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&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<h1>TCPServerSocket Class Reference</h1><!-- doxytag: class="TCPServerSocket" --><!-- doxytag: inherits="Socket" --><code>#include &lt;<a class="el" href="PracticalSocket_8h-source.html">PracticalSocket.h</a>&gt;</code>
<p>
<p>Inheritance diagram for TCPServerSocket:
<p><center><img src="classTCPServerSocket.png" usemap="#TCPServerSocket_map" border="0" alt=""></center>
<map name="TCPServerSocket_map">
<area href="classSocket.html" alt="Socket" shape="rect" coords="0,0,113,24">
</map>
<a href="classTCPServerSocket-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">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTCPServerSocket.html#e559a3154527d09fe14a8e5ee1f53d7a">TCPServerSocket</a> (unsigned short localPort, int queueLen=5)  throw (SocketException)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTCPServerSocket.html#3908fecb1b038f7c14fcc7726f54d01d">TCPServerSocket</a> (const string &amp;localAddress, unsigned short localPort, int queueLen=5)  throw (SocketException)</td></tr>

<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classTCPSocket.html">TCPSocket</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTCPServerSocket.html#1d161137e1b069de7a7bfc14d3f8212c">accept</a> ()  throw (SocketException)</td></tr>

<tr><td colspan="2"><br><h2>Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classTCPServerSocket.html#1f39a2e6721ab62d8875a234eb300bab">setListen</a> (int queueLen)  throw (SocketException)</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
TCP socket class for servers 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="e559a3154527d09fe14a8e5ee1f53d7a"></a><!-- doxytag: member="TCPServerSocket::TCPServerSocket" ref="e559a3154527d09fe14a8e5ee1f53d7a" args="(unsigned short localPort, int queueLen=5)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TCPServerSocket::TCPServerSocket           </td>
          <td>(</td>
          <td class="paramtype">unsigned short&nbsp;</td>
          <td class="paramname"> <em>localPort</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>queueLen</em> = <code>5</code></td><td>&nbsp;</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>
Construct a TCP socket for use with a server, accepting connections on the specified port on 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>&nbsp;</td><td>local port of server socket, a value of zero will give a system-assigned unused port </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>queueLen</em>&nbsp;</td><td>maximum queue length for outstanding connection requests (default 5) </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>&nbsp;</td><td>thrown if unable to create TCP server socket </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="3908fecb1b038f7c14fcc7726f54d01d"></a><!-- doxytag: member="TCPServerSocket::TCPServerSocket" ref="3908fecb1b038f7c14fcc7726f54d01d" args="(const string &amp;localAddress, unsigned short localPort, int queueLen=5)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TCPServerSocket::TCPServerSocket           </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>localAddress</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&nbsp;</td>
          <td class="paramname"> <em>localPort</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>queueLen</em> = <code>5</code></td><td>&nbsp;</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>
Construct a TCP socket for use with a server, accepting connections on the specified port on the interface specified by the given address <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>&nbsp;</td><td>local interface (address) of server socket </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>localPort</em>&nbsp;</td><td>local port of server socket </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>queueLen</em>&nbsp;</td><td>maximum queue length for outstanding connection requests (default 5) </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>&nbsp;</td><td>thrown if unable to create TCP server socket </td></tr>
  </table>
</dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="1d161137e1b069de7a7bfc14d3f8212c"></a><!-- doxytag: member="TCPServerSocket::accept" ref="1d161137e1b069de7a7bfc14d3f8212c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classTCPSocket.html">TCPSocket</a> * TCPServerSocket::accept           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">  throw (<a class="el" href="classSocketException.html">SocketException</a>)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Blocks until a new connection is established on this socket or error <dl class="return" compact><dt><b>Returns:</b></dt><dd>new connection 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>&nbsp;</td><td>thrown if attempt to accept a new connection fails </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="1f39a2e6721ab62d8875a234eb300bab"></a><!-- doxytag: member="TCPServerSocket::setListen" ref="1f39a2e6721ab62d8875a234eb300bab" args="(int queueLen)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TCPServerSocket::setListen           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>queueLen</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">  throw (<a class="el" href="classSocketException.html">SocketException</a>)<code> [private]</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&nbsp;
<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>