Class t.i.p.Protocol(BaseProtocol):

Part of twisted.internet.protocol View Source View In Hierarchy

Known subclasses: twisted.conch.client.agent.SSHAgentForwardingLocal, twisted.conch.insults.client.InsultsClient, twisted.conch.insults.helper.TerminalBuffer, twisted.conch.insults.insults.ClientProtocol, twisted.conch.insults.insults.ServerProtocol, twisted.conch.ssh.agent.SSHAgentClient, twisted.conch.ssh.agent.SSHAgentServer, twisted.conch.ssh.filetransfer.FileTransferBase, twisted.conch.ssh.forwarding.SSHForwardingClient, twisted.conch.ssh.session.SSHSessionClient, twisted.conch.ssh.transport.SSHTransportBase, twisted.conch.telnet.Telnet, twisted.conch.telnet.TelnetProtocol, twisted.names.dns.DNSProtocol, twisted.protocols.basic.IntNStringReceiver, twisted.protocols.basic.LineOnlyReceiver, twisted.protocols.basic.LineReceiver, twisted.protocols.basic.NetstringReceiver, twisted.protocols.ftp.DTP, twisted.protocols.ftp.ProtocolWrapper, twisted.protocols.ftp.SenderProtocol, twisted.protocols.gps.rockwell.Zodiac, twisted.protocols.mice.mouseman.MouseMan, twisted.protocols.policies.ProtocolWrapper, twisted.protocols.portforward.Proxy, twisted.protocols.socks.SOCKSv4, twisted.protocols.socks.SOCKSv4Incoming, twisted.protocols.socks.SOCKSv4Outgoing, twisted.protocols.stateful.StatefulProtocol, twisted.protocols.telnet.Telnet, twisted.protocols.wire.Chargen, twisted.protocols.wire.Daytime, twisted.protocols.wire.Discard, twisted.protocols.wire.Echo, twisted.protocols.wire.QOTD, twisted.protocols.wire.Time, twisted.protocols.wire.Who, twisted.runner.inetd.InetdProtocol, twisted.spread.banana.Banana, twisted.web.sux.XMLParser, twisted.web2.channel.cgi.BaseCGIChannelRequest, twisted.web2.channel.http.OverloadedServerProtocol, twisted.words.protocols.irc.DccFileReceiveBasic, twisted.words.protocols.irc.DccSendProtocol, twisted.words.protocols.irc.IRC, twisted.words.protocols.oscar.OscarConnection, twisted.words.protocols.toc.GetFileTransfer, twisted.words.protocols.toc.SendFileTransfer, twisted.words.protocols.toc.TOC, twisted.words.protocols.toc.TOCClient, twisted.words.xish.xmlstream.XmlStream (hide last 48 again) ... and 48 more

Implements interfaces: twisted.internet.interfaces.IProtocol

No class docstring

Split Table into Classes Show Methods in One Table

Line # Kind Name Docs
370 Method dataReceived Called whenever data is received.
384 Method connectionLost Called when the connection is shut down.

Inherited from BaseProtocol:

Line # Kind Name Docs
341 Method makeConnection Make a connection to a transport and a server.
351 Method connectionMade Called when a connection is made.
Line # Kind Name Docs
384 Method connectionLost Called when the connection is shut down.
351 Method connectionMade Called when a connection is made.
370 Method dataReceived Called whenever data is received.
341 Method makeConnection Make a connection to a transport and a server.
def dataReceived(self, data): (source)
overridden in twisted.conch.insults.client.InsultsClient, twisted.conch.insults.insults.ClientProtocol, twisted.conch.insults.insults.ServerProtocol, twisted.conch.ssh.agent.SSHAgentClient, twisted.conch.ssh.agent.SSHAgentServer, twisted.conch.ssh.filetransfer.FileTransferBase, twisted.conch.ssh.forwarding.SSHForwardingClient, twisted.conch.ssh.session.SSHSessionClient, twisted.conch.ssh.transport.SSHTransportBase, twisted.conch.telnet.Telnet, twisted.conch.telnet.TelnetBootstrapProtocol, twisted.names.dns.DNSProtocol, twisted.protocols.basic.IntNStringReceiver, twisted.protocols.basic.LineOnlyReceiver, twisted.protocols.basic.LineReceiver, twisted.protocols.basic.NetstringReceiver, twisted.protocols.ftp.DTP, twisted.protocols.ftp.ProtocolWrapper, twisted.protocols.ftp.SenderProtocol, twisted.protocols.gps.rockwell.Zodiac, twisted.protocols.mice.mouseman.MouseMan, twisted.protocols.policies.ProtocolWrapper, twisted.protocols.portforward.Proxy, twisted.protocols.socks.SOCKSv4, twisted.protocols.socks.SOCKSv4Incoming, twisted.protocols.socks.SOCKSv4Outgoing, twisted.protocols.stateful.StatefulProtocol, twisted.protocols.telnet.Telnet, twisted.protocols.wire.Discard, twisted.protocols.wire.Echo, twisted.spread.banana.Banana, twisted.web.sux.XMLParser, twisted.web2.channel.cgi.CGIChannelRequest, twisted.web2.channel.fastcgi.FastCGIChannelRequest, twisted.web2.channel.scgi.SCGIChannelRequest, twisted.words.protocols.irc.DccFileReceiveBasic, twisted.words.protocols.irc.DccSendProtocol, twisted.words.protocols.irc.IRC, twisted.words.protocols.oscar.OscarConnection, twisted.words.protocols.toc.GetFileTransfer, twisted.words.protocols.toc.SendFileTransfer, twisted.words.protocols.toc.TOC, twisted.words.protocols.toc.TOCClient, twisted.words.xish.xmlstream.XmlStream (hide last 41 again) ... and 41 more

Called whenever data is received.

Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.
Parametersdataa 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.
def connectionLost(self, reason=connectionDone): (source)
overridden in twisted.conch.client.unix.SSHUnixClientProtocol, twisted.conch.client.unix.SSHUnixServerProtocol, twisted.conch.insults.insults.ClientProtocol, twisted.conch.insults.insults.ServerProtocol, twisted.conch.ssh.filetransfer.FileTransferServer, twisted.conch.ssh.forwarding.SSHForwardingClient, twisted.conch.ssh.transport.SSHTransportBase, twisted.conch.telnet.StatefulTelnetProtocol, twisted.conch.telnet.StatefulTelnetProtocol, twisted.conch.telnet.Telnet, twisted.conch.telnet.TelnetBootstrapProtocol, twisted.mail.imap4.IMAP4Client, twisted.mail.imap4.IMAP4Server, twisted.mail.pop3.AdvancedPOP3Client, twisted.mail.pop3.POP3, twisted.mail.smtp.SMTP, twisted.mail.smtp.SMTPClient, twisted.names.dns.DNSProtocol, twisted.protocols.amp.BinaryBoxProtocol, twisted.protocols.ftp.DTP, twisted.protocols.ftp.FTP, twisted.protocols.ftp.FTPClientBasic, twisted.protocols.ftp.ProtocolWrapper, twisted.protocols.ftp.SenderProtocol, twisted.protocols.ident.IdentClient, twisted.protocols.policies.ProtocolWrapper, twisted.protocols.portforward.Proxy, twisted.protocols.socks.SOCKSv4, twisted.protocols.socks.SOCKSv4Incoming, twisted.protocols.socks.SOCKSv4Outgoing, twisted.spread.pb.Broker, twisted.web.http.HTTPChannel, twisted.web.http.HTTPClient, twisted.web.sux.XMLParser, twisted.web.woven.flashconduit.FlashConduit, twisted.web2.channel.cgi.CGIChannelRequest, twisted.web2.channel.http.HTTPChannel, twisted.web2.channel.scgi.SCGIChannelRequest, twisted.web2.client.http.HTTPClientProtocol, twisted.web2.twscgi.SCGIClientProtocol, twisted.words.im.proxyui.IRCUserInterface, twisted.words.protocols.irc.DccFileReceive, twisted.words.protocols.irc.DccSendProtocol, twisted.words.protocols.msn.FileReceive, twisted.words.protocols.msn.FileSend, twisted.words.protocols.msn.MSNEventBase, twisted.words.protocols.oscar.OscarConnection, twisted.words.protocols.toc.TOC, twisted.words.protocols.toc.TOCClient, twisted.words.service.IRCUser, twisted.words.xish.xmlstream.XmlStream (hide last 48 again) ... and 48 more

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Parametersreason (type: twisted.python.failure.Failure )
API Documentation for Twisted, generated by pydoctor at 2008-10-26 16:12:37.