~certify-web-dev/twisted/certify-trunk

« back to all changes in this revision

Viewing changes to doc/api/twisted.protocols.policies.ProtocolWrapper.html

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2004-06-21 22:01:11 UTC
  • mto: (2.2.3 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040621220111-vkf909euqnyrp3nr
Tags: upstream-1.3.0
ImportĀ upstreamĀ versionĀ 1.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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">
 
5
<head>
 
6
  <title>twisted.protocols.policies.ProtocolWrapper</title>
 
7
  <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
 
8
</head>
 
9
<body bgcolor="white" text="black" link="blue" vlink="#204080"
 
10
      alink="#204080">
 
11
 
 
12
<!-- =========== START OF NAVBAR =========== -->
 
13
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
 
14
  <tr valign="center">
 
15
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="twisted.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
 
16
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
 
17
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
 
18
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
 
19
    <th class="navbar" align="right" width="100%">
 
20
      <table border="0" cellpadding="0" cellspacing="0">
 
21
      <tr><th class="navbar" align="center">
 
22
        <p class="nomargin">
 
23
          <a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted&nbsp;1.3.0rc1</a>
 
24
      </p></th></tr></table>
 
25
    </th>
 
26
  </tr>
 
27
</table>
 
28
<table width="100%" cellpadding="0" cellspacing="0">
 
29
  <tr valign="top">
 
30
    <td width="100%">
 
31
      <font size="-1"><b class="breadcrumbs">
 
32
        <a href="twisted.html">Package&nbsp;twisted</a> ::
 
33
        <a href="twisted.protocols.html">Package&nbsp;protocols</a> ::
 
34
        <a href="twisted.protocols.policies.html">Module&nbsp;policies</a> ::
 
35
        Class&nbsp;ProtocolWrapper
 
36
      </b></font></br>
 
37
    </td>
 
38
    <td><table cellpadding="0" cellspacing="0">
 
39
      <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="twisted.protocols.policies.ProtocolWrapper.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
 
40
    </table></td>
 
41
</tr></table>
 
42
 
 
43
<!-- =========== START OF CLASS DESCRIPTION =========== -->
 
44
<h2 class="class">Class ProtocolWrapper</h2>
 
45
 
 
46
<pre class="base-tree">
 
47
<a href="twisted.internet.protocol.BaseProtocol.html"><code>BaseProtocol</code></a> --+    
 
48
               |    
 
49
        <a href="twisted.internet.protocol.Protocol.html"><code>Protocol</code></a> --+
 
50
                   |
 
51
                  <b>ProtocolWrapper</b>
 
52
</pre><br />
 
53
 
 
54
<dl><dt><b>Known Subclasses:</b></dt>
 
55
<dd>
 
56
    <a href="twisted.protocols.policies.SpewingProtocol.html"><code>SpewingProtocol</code></a>,
 
57
    <a href="twisted.protocols.policies.ThrottlingProtocol.html"><code>ThrottlingProtocol</code></a>,
 
58
    <a href="twisted.protocols.policies.TimeoutProtocol.html"><code>TimeoutProtocol</code></a></dd></dl>
 
59
 
 
60
<hr/>
 
61
 
 
62
Wraps protocol instances and acts as their transport as well.
 
63
<hr/>
 
64
 
 
65
 
 
66
<!-- =========== START OF METHOD SUMMARY =========== -->
 
67
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
 
68
<tr bgcolor="#70b0f0" class="summary">
 
69
  <th colspan="2">Method Summary</th></tr>
 
70
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
71
  <td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class=summary-sig-arg>self</span>,
 
72
          <span class=summary-sig-arg>factory</span>,
 
73
          <span class=summary-sig-arg>wrappedProtocol</span>)</span></code>
 
74
</td></tr>
 
75
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
76
  <td><code><a name="__getattr__"></a><span class="summary-sig"><span class="summary-sig-name">__getattr__</span>(<span class=summary-sig-arg>self</span>,
 
77
          <span class=summary-sig-arg>name</span>)</span></code>
 
78
</td></tr>
 
79
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
80
  <td><code><a name="connectionLost"></a><span class="summary-sig"><span class="summary-sig-name">connectionLost</span>(<span class=summary-sig-arg>self</span>,
 
81
          <span class=summary-sig-arg>reason</span>)</span></code>
 
82
</td></tr>
 
83
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
84
  <td><code><span class="summary-sig"><a href="twisted.protocols.policies.ProtocolWrapper.html#connectionMade" class="summary-sig-name"><code>connectionMade</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
 
85
<br />
 
86
Called when a connection is made.</td></tr>
 
87
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
88
  <td><code><span class="summary-sig"><a href="twisted.protocols.policies.ProtocolWrapper.html#dataReceived" class="summary-sig-name"><code>dataReceived</code></a>(<span class=summary-sig-arg>self</span>,
 
89
          <span class=summary-sig-arg>data</span>)</span></code>
 
90
<br />
 
91
Called whenever data is received.</td></tr>
 
92
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
93
  <td><code><a name="getHost"></a><span class="summary-sig"><span class="summary-sig-name">getHost</span>(<span class=summary-sig-arg>self</span>)</span></code>
 
94
</td></tr>
 
95
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
96
  <td><code><a name="getPeer"></a><span class="summary-sig"><span class="summary-sig-name">getPeer</span>(<span class=summary-sig-arg>self</span>)</span></code>
 
97
</td></tr>
 
98
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
99
  <td><code><a name="loseConnection"></a><span class="summary-sig"><span class="summary-sig-name">loseConnection</span>(<span class=summary-sig-arg>self</span>)</span></code>
 
100
</td></tr>
 
101
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
102
  <td><code><span class="summary-sig"><a href="twisted.protocols.policies.ProtocolWrapper.html#makeConnection" class="summary-sig-name"><code>makeConnection</code></a>(<span class=summary-sig-arg>self</span>,
 
103
          <span class=summary-sig-arg>transport</span>)</span></code>
 
104
<br />
 
105
Make a connection to a transport and a server.</td></tr>
 
106
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
107
  <td><code><a name="registerProducer"></a><span class="summary-sig"><span class="summary-sig-name">registerProducer</span>(<span class=summary-sig-arg>self</span>,
 
108
          <span class=summary-sig-arg>producer</span>,
 
109
          <span class=summary-sig-arg>streaming</span>)</span></code>
 
110
</td></tr>
 
111
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
112
  <td><code><a name="stopConsuming"></a><span class="summary-sig"><span class="summary-sig-name">stopConsuming</span>(<span class=summary-sig-arg>self</span>)</span></code>
 
113
</td></tr>
 
114
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
115
  <td><code><a name="unregisterProducer"></a><span class="summary-sig"><span class="summary-sig-name">unregisterProducer</span>(<span class=summary-sig-arg>self</span>)</span></code>
 
116
</td></tr>
 
117
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
118
  <td><code><a name="write"></a><span class="summary-sig"><span class="summary-sig-name">write</span>(<span class=summary-sig-arg>self</span>,
 
119
          <span class=summary-sig-arg>data</span>)</span></code>
 
120
</td></tr>
 
121
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
122
  <td><code><a name="writeSequence"></a><span class="summary-sig"><span class="summary-sig-name">writeSequence</span>(<span class=summary-sig-arg>self</span>,
 
123
          <span class=summary-sig-arg>data</span>)</span></code>
 
124
</td></tr>
 
125
<tr bgcolor="#e8f0f8" class="group">
 
126
  <th colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;Inherited from Protocol</th></tr>
 
127
<tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
 
128
  <td><code><span class="summary-sig"><a href="twisted.internet.protocol.Protocol.html#connectionFailed" class="summary-sig-name"><code>connectionFailed</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
 
129
<br />
 
130
(Deprecated)</td></tr>
 
131
</table><br />
 
132
 
 
133
 
 
134
<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->
 
135
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
 
136
<tr bgcolor="#70b0f0" class="summary">
 
137
  <th colspan="2">Class Variable Summary</th></tr>
 
138
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>tuple</code></font></td>
 
139
<td><b><a href="twisted.protocols.policies.ProtocolWrapper.html#__implements__"><code>__implements__</code></a></b> = <span title="(&lt;class twisted.internet.interfaces.ITransport at 0x8254024&gt;,)"><code>(&lt;class&nbsp;twisted.internet.interfaces.ITr<span class="variable-ellipsis">...</span></code>
 
140
</span></td></tr>
 
141
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
 
142
<td><b><a href="twisted.protocols.policies.ProtocolWrapper.html#disconnecting"><code>disconnecting</code></a></b> = <span title="0">0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
 
143
<tr bgcolor="#e8f0f8" class="group">
 
144
  <th colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;Inherited from BaseProtocol</th></tr>
 
145
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
 
146
<td><b><a href="twisted.internet.protocol.BaseProtocol.html#connected"><code>connected</code></a></b> = <span title="0">0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
 
147
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>NoneType</code></font></td>
 
148
<td><b><a href="twisted.internet.protocol.BaseProtocol.html#transport"><code>transport</code></a></b> = <span title="None">None&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
 
149
</table><br />
 
150
 
 
151
 
 
152
<!-- =========== START OF METHOD DETAILS =========== -->
 
153
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
 
154
<tr bgcolor="#70b0f0" class="details">
 
155
  <th colspan="2">Method Details</th></tr>
 
156
</table>
 
157
 
 
158
<a name="connectionMade"></a>
 
159
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
 
160
  <h3><span class="sig"><span class="sig-name">connectionMade</span>(<span class=sig-arg>self</span>)</span>
 
161
  </h3>
 
162
  <p>Called when a connection is made.</p>
 
163
  This may be considered the initializer of the protocol, because it 
 
164
  is called when the connection is completed. For clients, this is called 
 
165
  once the connection to the server has been established; for servers, 
 
166
  this is called after an accept() call stops blocking and a socket has 
 
167
  been received. If you need to send any greeting or initial message, do 
 
168
  it here.
 
169
  <dl><dt></dt><dd>
 
170
    <dl><dt><b>Overrides:</b></dt>
 
171
      <dd><a href="twisted.internet.protocol.BaseProtocol.html#connectionMade"><code>twisted.internet.protocol.BaseProtocol.connectionMade</code></a> <i>(inherited documentation)</i>
 
172
</dd>
 
173
    </dl>
 
174
  </dd></dl>
 
175
</td></tr></table>
 
176
 
 
177
<a name="dataReceived"></a>
 
178
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
 
179
  <h3><span class="sig"><span class="sig-name">dataReceived</span>(<span class=sig-arg>self</span>,
 
180
          <span class=sig-arg>data</span>)</span>
 
181
  </h3>
 
182
  <p>Called whenever data is received.</p>
 
183
  Use this method to translate to a higher-level message. Usually, 
 
184
  some callback will be made upon the receipt of each complete protocol 
 
185
  message.
 
186
  <dl><dt></dt><dd>
 
187
    <dl><dt><b>Parameters:</b></dt>
 
188
      <dd><code><b>data</b></code> -
 
189
         a string of indeterminate length. Please keep in mind that you 
 
190
        will probably need to buffer some data, as partial (or multiple) 
 
191
        protocol messages may be received! I recommend that unit tests 
 
192
        for protocols call through to this method with differing chunk 
 
193
        sizes, down to one byte at a time.
 
194
      </dd>
 
195
    </dl>
 
196
    <dl><dt><b>Overrides:</b></dt>
 
197
      <dd><a href="twisted.internet.protocol.Protocol.html#dataReceived"><code>twisted.internet.protocol.Protocol.dataReceived</code></a> <i>(inherited documentation)</i>
 
198
</dd>
 
199
    </dl>
 
200
  </dd></dl>
 
201
</td></tr></table>
 
202
 
 
203
<a name="makeConnection"></a>
 
204
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
 
205
  <h3><span class="sig"><span class="sig-name">makeConnection</span>(<span class=sig-arg>self</span>,
 
206
          <span class=sig-arg>transport</span>)</span>
 
207
  </h3>
 
208
  <p>Make a connection to a transport and a server.</p>
 
209
  This sets the 'transport' attribute of this Protocol, and calls the 
 
210
  connectionMade() callback.
 
211
  <dl><dt></dt><dd>
 
212
    <dl><dt><b>Overrides:</b></dt>
 
213
      <dd><a href="twisted.internet.protocol.BaseProtocol.html#makeConnection"><code>twisted.internet.protocol.BaseProtocol.makeConnection</code></a> <i>(inherited documentation)</i>
 
214
</dd>
 
215
    </dl>
 
216
  </dd></dl>
 
217
</td></tr></table>
 
218
<br />
 
219
 
 
220
 
 
221
<!-- =========== START OF CLASS VARIABLE DETAILS =========== -->
 
222
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
 
223
<tr bgcolor="#70b0f0" class="details">
 
224
  <th colspan="2">Class Variable Details</th></tr>
 
225
</table>
 
226
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
 
227
<a name="__implements__"></a>
 
228
<h3>__implements__</h3>
 
229
<dl>
 
230
  <dt></dt>
 
231
  <dd>
 
232
    <dl>
 
233
      <dt><b>Type:</b></dt>
 
234
      <dd>
 
235
          <code>tuple</code>
 
236
 
 
237
      </dd>
 
238
<span title="(&lt;class twisted.internet.interfaces.ITransport at 0x8254024&gt;,)">      <dt><b>Value:</b></dt>
 
239
      <dd><table><tr><td>
 
240
<pre class="variable">
 
241
(&lt;class twisted.internet.interfaces.ITransport at 0x8254024&gt;,)         </pre>
 
242
        </td></tr></table></dd>
 
243
</span>    </dl>
 
244
  </dd>
 
245
</dl></td></tr></table>
 
246
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
 
247
<a name="disconnecting"></a>
 
248
<h3>disconnecting</h3>
 
249
<dl>
 
250
  <dt></dt>
 
251
  <dd>
 
252
    <dl>
 
253
      <dt><b>Type:</b></dt>
 
254
      <dd>
 
255
          <code>int</code>
 
256
 
 
257
      </dd>
 
258
<span title="0">      <dt><b>Value:</b></dt>
 
259
      <dd><table><tr><td>
 
260
<pre class="variable">
 
261
0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</pre>
 
262
        </td></tr></table></dd>
 
263
</span>    </dl>
 
264
  </dd>
 
265
</dl></td></tr></table>
 
266
<br />
 
267
 
 
268
 
 
269
<!-- =========== START OF NAVBAR =========== -->
 
270
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
 
271
  <tr valign="center">
 
272
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="twisted.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
 
273
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
 
274
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
 
275
    <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
 
276
    <th class="navbar" align="right" width="100%">
 
277
      <table border="0" cellpadding="0" cellspacing="0">
 
278
      <tr><th class="navbar" align="center">
 
279
        <p class="nomargin">
 
280
          <a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted&nbsp;1.3.0rc1</a>
 
281
      </p></th></tr></table>
 
282
    </th>
 
283
  </tr>
 
284
</table>
 
285
 
 
286
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
287
  <tr>
 
288
    <td align="left"><font size="-2">Generated by Epydoc 2.0 on Sat May 15 20:07:52 2004</font></td>
 
289
    <td align="right"><a href="http://epydoc.sourceforge.net"
 
290
                      ><font size="-2">http://epydoc.sf.net</font></a></td>
 
291
  </tr>
 
292
</table>
 
293
</body>
 
294
</html>