twisted.internet.protocol.Protocol.html [plain text]
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>twisted.internet.protocol.Protocol</title>
<link rel="stylesheet" href="epydoc.css" type="text/css"></link>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
<tr valign="center">
<th class="navbar"> <a class="navbar" href="twisted.html">Home</a> </th>
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center">
<p class="nomargin">
<a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted 1.3.0rc1</a>
</p></th></tr></table>
</th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<font size="-1"><b class="breadcrumbs">
<a href="twisted.html">Package twisted</a> ::
<a href="twisted.internet.html">Package internet</a> ::
<a href="twisted.internet.protocol.html">Module protocol</a> ::
Class Protocol
</b></font></br>
</td>
<td><table cellpadding="0" cellspacing="0">
<tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a> | <a href="twisted.internet.protocol.Protocol.html" target="_top">no frames</a>]</font></td></tr>
</table></td>
</tr></table>
<!-- =========== START OF CLASS DESCRIPTION =========== -->
<h2 class="class">Class Protocol</h2>
<pre class="base-tree">
<a href="twisted.internet.protocol.BaseProtocol.html"><code>BaseProtocol</code></a> --+
|
<b>Protocol</b>
</pre><br />
<dl><dt><b>Known Subclasses:</b></dt>
<dd>
<a href="twisted.flow.protocol._Protocol.html"><code>_Protocol</code></a>,
<a href="twisted.protocols.wire.Chargen.html"><code>Chargen</code></a>,
<a href="twisted.protocols.wire.Daytime.html"><code>Daytime</code></a>,
<a href="twisted.protocols.irc.DccFileReceiveBasic.html"><code>DccFileReceiveBasic</code></a>,
<a href="twisted.protocols.irc.DccSendProtocol.html"><code>DccSendProtocol</code></a>,
<a href="twisted.protocols.wire.Discard.html"><code>Discard</code></a>,
<a href="twisted.protocols.ftp.DTP.html"><code>DTP</code></a>,
<a href="twisted.protocols.wire.Echo.html"><code>Echo</code></a>,
<a href="twisted.protocols.toc.GetFileTransfer.html"><code>GetFileTransfer</code></a>,
<a href="twisted.runner.inetd.InetdProtocol.html"><code>InetdProtocol</code></a>,
<a href="twisted.conch.insults.client.InsultsClient.html"><code>InsultsClient</code></a>,
<a href="twisted.protocols.basic.Int16StringReceiver.html"><code>Int16StringReceiver</code></a>,
<a href="twisted.protocols.basic.Int32StringReceiver.html"><code>Int32StringReceiver</code></a>,
<a href="twisted.protocols.irc.IRC.html"><code>IRC</code></a>,
<a href="twisted.protocols.basic.LineOnlyReceiver.html"><code>LineOnlyReceiver</code></a>,
<a href="twisted.protocols.basic.LineReceiver.html"><code>LineReceiver</code></a>,
<a href="twisted.protocols.mice.mouseman.MouseMan.html"><code>MouseMan</code></a>,
<a href="twisted.protocols.basic.NetstringReceiver.html"><code>NetstringReceiver</code></a>,
<a href="twisted.protocols.oscar.OscarConnection.html"><code>OscarConnection</code></a>,
<a href="twisted.protocols.ftp.ProtocolWrapper.html"><code>ProtocolWrapper</code></a>,
<a href="twisted.protocols.policies.ProtocolWrapper.html"><code>ProtocolWrapper</code></a>,
<a href="twisted.protocols.portforward.Proxy.html"><code>Proxy</code></a>,
<a href="twisted.spread.banana.Pynana.html"><code>Pynana</code></a>,
<a href="twisted.protocols.wire.QOTD.html"><code>QOTD</code></a>,
<a href="twisted.protocols.ftp.SenderProtocol.html"><code>SenderProtocol</code></a>,
<a href="twisted.protocols.toc.SendFileTransfer.html"><code>SendFileTransfer</code></a>,
<a href="twisted.protocols.socks.SOCKSv4.html"><code>SOCKSv4</code></a>,
<a href="twisted.protocols.socks.SOCKSv4Incoming.html"><code>SOCKSv4Incoming</code></a>,
<a href="twisted.protocols.socks.SOCKSv4Outgoing.html"><code>SOCKSv4Outgoing</code></a>,
<a href="twisted.conch.ssh.forwarding.SSHForwardingClient.html"><code>SSHForwardingClient</code></a>,
<a href="twisted.conch.ssh.session.SSHSessionClient.html"><code>SSHSessionClient</code></a>,
<a href="twisted.protocols.stateful.StatefulProtocol.html"><code>StatefulProtocol</code></a>,
<a href="twisted.protocols.telnet.Telnet.html"><code>Telnet</code></a>,
<a href="twisted.protocols.wire.Time.html"><code>Time</code></a>,
<a href="twisted.protocols.toc.TOC.html"><code>TOC</code></a>,
<a href="twisted.protocols.toc.TOCClient.html"><code>TOCClient</code></a>,
<a href="twisted.protocols.wire.Who.html"><code>Who</code></a>,
<a href="twisted.protocols.sux.XMLParser.html"><code>XMLParser</code></a>,
<a href="twisted.protocols.xmlstream.XmlStream.html"><code>XmlStream</code></a>,
<a href="twisted.protocols.gps.rockwell.Zodiac.html"><code>Zodiac</code></a></dd></dl>
<hr/>
<!-- =========== START OF METHOD SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
<th colspan="2">Method Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<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>
<br />
(Deprecated)</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.internet.protocol.Protocol.html#connectionLost" class="summary-sig-name"><code>connectionLost</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>reason</span>)</span></code>
<br />
Called when the connection is shut down.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.internet.protocol.Protocol.html#dataReceived" class="summary-sig-name"><code>dataReceived</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>data</span>)</span></code>
<br />
Called whenever data is received.</td></tr>
<tr bgcolor="#e8f0f8" class="group">
<th colspan="2"> Inherited from BaseProtocol</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.internet.protocol.BaseProtocol.html#connectionMade" class="summary-sig-name"><code>connectionMade</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
<br />
Called when a connection is made.</td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
<td><code><span class="summary-sig"><a href="twisted.internet.protocol.BaseProtocol.html#makeConnection" class="summary-sig-name"><code>makeConnection</code></a>(<span class=summary-sig-arg>self</span>,
<span class=summary-sig-arg>transport</span>)</span></code>
<br />
Make a connection to a transport and a server.</td></tr>
</table><br />
<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="summary">
<th colspan="2">Class Variable Summary</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>tuple</code></font></td>
<td><b><a href="twisted.internet.protocol.Protocol.html#__implements__"><code>__implements__</code></a></b> = <span title="(<class twisted.internet.interfaces.IProtocol at 0x8278f0c>,)"><code>(<class twisted.internet.interfaces.IPr<span class="variable-ellipsis">...</span></code>
</span></td></tr>
<tr bgcolor="#e8f0f8" class="group">
<th colspan="2"> Inherited from BaseProtocol</th></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
<td><b><a href="twisted.internet.protocol.BaseProtocol.html#connected"><code>connected</code></a></b> = <span title="0">0 </span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>NoneType</code></font></td>
<td><b><a href="twisted.internet.protocol.BaseProtocol.html#transport"><code>transport</code></a></b> = <span title="None">None </span></td></tr>
</table><br />
<!-- =========== START OF METHOD DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
<th colspan="2">Method Details</th></tr>
</table>
<a name="connectionFailed"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">connectionFailed</span>(<span class=sig-arg>self</span>)</span>
</h3>
<p>(Deprecated)</p>
This used to be called when the connection was not properly
established.
<dl><dt></dt><dd>
</dd></dl>
</td></tr></table>
<a name="connectionLost"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">connectionLost</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>reason</span>=<span class=sig-default><twisted.python.failure.Failure twisted.internet.error.Co...</span>)</span>
</h3>
<p>Called when the connection is shut down.</p>
Clear any circular references here, and any external references to
this Protocol. The connection has been closed.
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>reason</b></code>
<br /><i>
(type=<a href="twisted.python.failure.Failure.html"
class="link"><code>twisted.python.failure.Failure</code></a>)</i>
</dd>
</dl>
</dd></dl>
</td></tr></table>
<a name="dataReceived"></a>
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
<h3><span class="sig"><span class="sig-name">dataReceived</span>(<span class=sig-arg>self</span>,
<span class=sig-arg>data</span>)</span>
</h3>
<p>Called whenever data is received.</p>
Use this method to translate to a higher-level message. Usually,
some callback will be made upon the receipt of each complete protocol
message.
<dl><dt></dt><dd>
<dl><dt><b>Parameters:</b></dt>
<dd><code><b>data</b></code> -
a string of indeterminate length. Please keep in mind that you
will probably need to buffer some data, as partial (or multiple)
protocol messages may be received! I recommend that unit tests
for protocols call through to this method with differing chunk
sizes, down to one byte at a time.
</dd>
</dl>
</dd></dl>
</td></tr></table>
<br />
<!-- =========== START OF CLASS VARIABLE DETAILS =========== -->
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="details">
<th colspan="2">Class Variable Details</th></tr>
</table>
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
<a name="__implements__"></a>
<h3>__implements__</h3>
<dl>
<dt></dt>
<dd>
<dl>
<dt><b>Type:</b></dt>
<dd>
<code>tuple</code>
</dd>
<span title="(<class twisted.internet.interfaces.IProtocol at 0x8278f0c>,)"> <dt><b>Value:</b></dt>
<dd><table><tr><td>
<pre class="variable">
(<class twisted.internet.interfaces.IProtocol at 0x8278f0c>,) </pre>
</td></tr></table></dd>
</span> </dl>
</dd>
</dl></td></tr></table>
<br />
<!-- =========== START OF NAVBAR =========== -->
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
<tr valign="center">
<th class="navbar"> <a class="navbar" href="twisted.html">Home</a> </th>
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center">
<p class="nomargin">
<a class="navbar" target="_top" href="http://twistedmatrix.com/">Twisted 1.3.0rc1</a>
</p></th></tr></table>
</th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left"><font size="-2">Generated by Epydoc 2.0 on Sat May 15 20:08:24 2004</font></td>
<td align="right"><a href="http://epydoc.sourceforge.net"
><font size="-2">http://epydoc.sf.net</font></a></td>
</tr>
</table>
</body>
</html>