1
<?xml version="1.0" encoding="iso-8859-1"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
"DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
<title>twisted.internet.unix.Server</title>
7
<link rel="stylesheet" href="epydoc.css" type="text/css"></link>
9
<body bgcolor="white" text="black" link="blue" vlink="#204080"
12
<!-- =========== START OF NAVBAR =========== -->
13
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
15
<th class="navbar"> <a class="navbar" href="twisted.html">Home</a> </th>
16
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
17
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
18
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
19
<th class="navbar" align="right" width="100%">
20
<table border="0" cellpadding="0" cellspacing="0">
21
<tr><th class="navbar" align="center">
23
<a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted 1.3.0rc1</a>
24
</p></th></tr></table>
28
<table width="100%" cellpadding="0" cellspacing="0">
31
<font size="-1"><b class="breadcrumbs">
32
<a href="twisted.html">Package twisted</a> ::
33
<a href="twisted.internet.html">Package internet</a> ::
34
<a href="twisted.internet.unix.html">Module unix</a> ::
38
<td><table cellpadding="0" cellspacing="0">
39
<tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a> | <a href="twisted.internet.unix.Server.html" target="_top">no frames</a>]</font></td></tr>
43
<!-- =========== START OF CLASS DESCRIPTION =========== -->
44
<h2 class="class">Class Server</h2>
46
<pre class="base-tree">
47
<a href="twisted.persisted.styles.Ephemeral.html"><code>Ephemeral</code></a> --+
49
<a href="twisted.python.log.Logger.html"><code>Logger</code></a> --+
51
<a href="twisted.internet.abstract.FileDescriptor.html"><code>FileDescriptor</code></a> --+
53
<a href="twisted.internet.tcp.Connection.html"><code>Connection</code></a> --+
55
<a href="twisted.internet.tcp.Server.html"><code>Server</code></a> --+
63
<!-- =========== START OF METHOD SUMMARY =========== -->
64
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
65
<tr bgcolor="#70b0f0" class="summary">
66
<th colspan="2">Method Summary</th></tr>
67
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
68
<td><code><span class="summary-sig"><a href="twisted.internet.unix.Server.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class=summary-sig-arg>self</span>,
69
<span class=summary-sig-arg>sock</span>,
70
<span class=summary-sig-arg>protocol</span>,
71
<span class=summary-sig-arg>client</span>,
72
<span class=summary-sig-arg>server</span>,
73
<span class=summary-sig-arg>sessionno</span>)</span></code>
75
Server(sock, protocol, client, server, sessionno)</td></tr>
76
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
77
<td><code><span class="summary-sig"><a href="twisted.internet.unix.Server.html#getHost" class="summary-sig-name"><code>getHost</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
79
Returns an IPv4Address.</td></tr>
80
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
81
<td><code><span class="summary-sig"><a href="twisted.internet.unix.Server.html#getPeer" class="summary-sig-name"><code>getPeer</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
83
Returns an IPv4Address.</td></tr>
84
<tr bgcolor="#e8f0f8" class="group">
85
<th colspan="2"> Inherited from Server</th></tr>
86
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
87
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Server.html#__repr__" class="summary-sig-name"><code>__repr__</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
89
A string representation of this connection.</td></tr>
90
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
91
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Server.html#startTLS" class="summary-sig-name"><code>startTLS</code></a>(<span class=summary-sig-arg>self</span>,
92
<span class=summary-sig-arg>ctx</span>,
93
<span class=summary-sig-arg>server</span>)</span></code>
95
<tr bgcolor="#e8f0f8" class="group">
96
<th colspan="2"> Inherited from Connection</th></tr>
97
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
98
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#_closeSocket" class="summary-sig-name"><code>_closeSocket</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
100
Called to close our socket.</td></tr>
101
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
102
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#_startTLS" class="summary-sig-name"><code>_startTLS</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
104
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
105
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#connectionLost" class="summary-sig-name"><code>connectionLost</code></a>(<span class=summary-sig-arg>self</span>,
106
<span class=summary-sig-arg>reason</span>)</span></code>
108
See abstract.FileDescriptor.connectionLost().</td></tr>
109
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
110
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#doRead" class="summary-sig-name"><code>doRead</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
112
Calls self.protocol.dataReceived with all available data.</td></tr>
113
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
114
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#getHandle" class="summary-sig-name"><code>getHandle</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
116
Return the socket for this connection.</td></tr>
117
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
118
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#getTcpKeepAlive" class="summary-sig-name"><code>getTcpKeepAlive</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
120
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
121
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#getTcpNoDelay" class="summary-sig-name"><code>getTcpNoDelay</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
123
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
124
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#logPrefix" class="summary-sig-name"><code>logPrefix</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
126
Return the prefix to log with when I own the logging thread.</td></tr>
127
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
128
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#setTcpKeepAlive" class="summary-sig-name"><code>setTcpKeepAlive</code></a>(<span class=summary-sig-arg>self</span>,
129
<span class=summary-sig-arg>enabled</span>)</span></code>
131
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
132
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#setTcpNoDelay" class="summary-sig-name"><code>setTcpNoDelay</code></a>(<span class=summary-sig-arg>self</span>,
133
<span class=summary-sig-arg>enabled</span>)</span></code>
135
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
136
<td><code><span class="summary-sig"><a href="twisted.internet.tcp.Connection.html#writeSomeData" class="summary-sig-name"><code>writeSomeData</code></a>(<span class=summary-sig-arg>self</span>,
137
<span class=summary-sig-arg>data</span>)</span></code>
139
Connection.writeSomeData(data) -> #of bytes written |
140
CONNECTION_LOST This writes as much data as possible to the socket and
141
returns either the number of bytes read (which is positive) or a
142
connection error code (which is negative)</td></tr>
143
<tr bgcolor="#e8f0f8" class="group">
144
<th colspan="2"> Inherited from FileDescriptor</th></tr>
145
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
146
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#_postLoseConnection" class="summary-sig-name"><code>_postLoseConnection</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
148
Called after a loseConnection(), when all data has been written.</td></tr>
149
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
150
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#doWrite" class="summary-sig-name"><code>doWrite</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
152
Called when data is available for writing.</td></tr>
153
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
154
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#fileno" class="summary-sig-name"><code>fileno</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
156
File Descriptor number for select().</td></tr>
157
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
158
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#loseConnection" class="summary-sig-name"><code>loseConnection</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
160
Close the connection at the next available opportunity.</td></tr>
161
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
162
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#pauseProducing" class="summary-sig-name"><code>pauseProducing</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
164
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
165
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#registerProducer" class="summary-sig-name"><code>registerProducer</code></a>(<span class=summary-sig-arg>self</span>,
166
<span class=summary-sig-arg>producer</span>,
167
<span class=summary-sig-arg>streaming</span>)</span></code>
169
Register to receive data from a producer.</td></tr>
170
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
171
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#resumeProducing" class="summary-sig-name"><code>resumeProducing</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
173
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
174
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#startReading" class="summary-sig-name"><code>startReading</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
176
Start waiting for read availability.</td></tr>
177
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
178
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#startWriting" class="summary-sig-name"><code>startWriting</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
180
Start waiting for write availability.</td></tr>
181
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
182
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#stopConsuming" class="summary-sig-name"><code>stopConsuming</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
184
Stop consuming data.</td></tr>
185
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
186
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#stopProducing" class="summary-sig-name"><code>stopProducing</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
188
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
189
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#stopReading" class="summary-sig-name"><code>stopReading</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
191
Stop waiting for read availability.</td></tr>
192
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
193
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#stopWriting" class="summary-sig-name"><code>stopWriting</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
195
Stop waiting for write availability.</td></tr>
196
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
197
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#unregisterProducer" class="summary-sig-name"><code>unregisterProducer</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
199
Stop consuming data from a producer, without disconnecting.</td></tr>
200
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
201
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#write" class="summary-sig-name"><code>write</code></a>(<span class=summary-sig-arg>self</span>,
202
<span class=summary-sig-arg>data</span>)</span></code>
204
Reliably write some data.</td></tr>
205
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
206
<td><code><span class="summary-sig"><a href="twisted.internet.abstract.FileDescriptor.html#writeSequence" class="summary-sig-name"><code>writeSequence</code></a>(<span class=summary-sig-arg>self</span>,
207
<span class=summary-sig-arg>iovec</span>)</span></code>
209
<tr bgcolor="#e8f0f8" class="group">
210
<th colspan="2"> Inherited from Ephemeral</th></tr>
211
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
212
<td><code><span class="summary-sig"><a href="twisted.persisted.styles.Ephemeral.html#__getstate__" class="summary-sig-name"><code>__getstate__</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
214
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
215
<td><code><span class="summary-sig"><a href="twisted.persisted.styles.Ephemeral.html#__setstate__" class="summary-sig-name"><code>__setstate__</code></a>(<span class=summary-sig-arg>self</span>,
216
<span class=summary-sig-arg>state</span>)</span></code>
221
<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->
222
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
223
<tr bgcolor="#70b0f0" class="summary">
224
<th colspan="2">Class Variable Summary</th></tr>
225
<tr bgcolor="#e8f0f8" class="group">
226
<th colspan="2"> Inherited from Connection</th></tr>
227
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>tuple</code></font></td>
228
<td><b><a href="twisted.internet.tcp.Connection.html#__implements__"><code>__implements__</code></a></b> = <span title="((<class twisted.internet.interfaces.IProducer at 0x827b064>, <class twisted.internet.interfaces.IReadWriteDescriptor at 0x827d20c>, <class twisted.internet.interfaces.IConsumer at 0x824feb4>, <class twisted.internet.interfaces.ITransport at 0x8254024>), <class twisted.internet.interfaces.ITCPTransport at 0x8241624>, <class twisted.internet.interfaces.ISystemHandle at 0x827cf14>, <class twisted.internet.interfaces.ITLSTransport at 0x8241654>)"><code>((<class twisted.internet.interfaces.IP<span class="variable-ellipsis">...</span></code>
230
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>str</code></font></td>
231
<td><b><a href="twisted.internet.tcp.Connection.html#logstr"><code>logstr</code></a></b> = <span title="'Uninitialized'"><code><span class="variable-quote">'</span>Uninitialized<span class="variable-quote">'</span> </code>
233
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
234
<td><b><a href="twisted.internet.tcp.Connection.html#TLS"><code>TLS</code></a></b> = <span title="0">0 </span></td></tr>
235
<tr bgcolor="#e8f0f8" class="group">
236
<th colspan="2"> Inherited from FileDescriptor</th></tr>
237
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
238
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#bufferSize"><code>bufferSize</code></a></b> = <span title="65536">65536 </span></td></tr>
239
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
240
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#connected"><code>connected</code></a></b> = <span title="0">0 </span></td></tr>
241
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>str</code></font></td>
242
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#dataBuffer"><code>dataBuffer</code></a></b> = <span title="''"><code><span class="variable-quote">'</span><span class="variable-quote">'</span> </code>
244
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
245
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#disconnected"><code>disconnected</code></a></b> = <span title="0">0 </span></td></tr>
246
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
247
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#disconnecting"><code>disconnecting</code></a></b> = <span title="0">0 </span></td></tr>
248
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
249
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#offset"><code>offset</code></a></b> = <span title="0">0 </span></td></tr>
250
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>NoneType</code></font></td>
251
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#producer"><code>producer</code></a></b> = <span title="None">None </span></td></tr>
252
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
253
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#producerPaused"><code>producerPaused</code></a></b> = <span title="0">0 </span></td></tr>
254
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
255
<td><b><a href="twisted.internet.abstract.FileDescriptor.html#streamingProducer"><code>streamingProducer</code></a></b> = <span title="0">0 </span></td></tr>
259
<!-- =========== START OF METHOD DETAILS =========== -->
260
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
261
<tr bgcolor="#70b0f0" class="details">
262
<th colspan="2">Method Details</th></tr>
265
<a name="__init__"></a>
266
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
267
<h3><span class="sig"><span class="sig-name">__init__</span>(<span class=sig-arg>self</span>,
268
<span class=sig-arg>sock</span>,
269
<span class=sig-arg>protocol</span>,
270
<span class=sig-arg>client</span>,
271
<span class=sig-arg>server</span>,
272
<span class=sig-arg>sessionno</span>)</span>
273
<br /><i>(Constructor)</i>
275
<p>Server(sock, protocol, client, server, sessionno)</p>
276
Initialize me with a socket, a protocol, a descriptor for my peer (a
277
tuple of host, port describing the other end of the connection), an
278
instance of Port, and a session number.
280
<dl><dt><b>Overrides:</b></dt>
281
<dd><a href="twisted.internet.tcp.Server.html#__init__"><code>twisted.internet.tcp.Server.__init__</code></a> <i>(inherited documentation)</i>
287
<a name="getHost"></a>
288
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
289
<h3><span class="sig"><span class="sig-name">getHost</span>(<span class=sig-arg>self</span>)</span>
291
<p>Returns an IPv4Address.</p>
292
This indicates the server's address.
294
<dl><dt><b>Overrides:</b></dt>
295
<dd><a href="twisted.internet.tcp.Server.html#getHost"><code>twisted.internet.tcp.Server.getHost</code></a> <i>(inherited documentation)</i>
301
<a name="getPeer"></a>
302
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
303
<h3><span class="sig"><span class="sig-name">getPeer</span>(<span class=sig-arg>self</span>)</span>
305
<p>Returns an IPv4Address.</p>
306
This indicates the client's address.
308
<dl><dt><b>Overrides:</b></dt>
309
<dd><a href="twisted.internet.tcp.Server.html#getPeer"><code>twisted.internet.tcp.Server.getPeer</code></a> <i>(inherited documentation)</i>
317
<!-- =========== START OF NAVBAR =========== -->
318
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
320
<th class="navbar"> <a class="navbar" href="twisted.html">Home</a> </th>
321
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
322
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
323
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
324
<th class="navbar" align="right" width="100%">
325
<table border="0" cellpadding="0" cellspacing="0">
326
<tr><th class="navbar" align="center">
328
<a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted 1.3.0rc1</a>
329
</p></th></tr></table>
334
<table border="0" cellpadding="0" cellspacing="0" width="100%">
336
<td align="left"><font size="-2">Generated by Epydoc 2.0 on Sat May 15 20:08:14 2004</font></td>
337
<td align="right"><a href="http://epydoc.sourceforge.net"
338
><font size="-2">http://epydoc.sf.net</font></a></td>