def makeConnection(self, transport): ([source][1])
"""
overridden in twisted.protocols.amp.BinaryBoxProtocol,
twisted.protocols.ftp.ProtocolWrapper, twisted.protocols.ftp.SenderProtocol,
twisted.protocols.policies.ProtocolWrapper,
twisted.protocols.stateful.StatefulProtocol`
Make a connection to a transport and a server.
This sets the 'transport' attribute of this Protocol, and calls the connectionMade()
callback.
"""
Транспорт - это соединение с тем, что вы используете, например, telnet, SSH, файл и т. Д. Найдите в документации по API онлайн transport
и посмотрите, например,
http://twistedmatrix.com/documents/8.2.0/api/twisted.conch.ssh.transport.SSHTransportBase.html
Вот некоторые из существующих транспортов: http://twistedmatrix.com/documents/8.2.0/api/twisted.internet.interfaces.ITransport.html
Known subclasses: twisted.conch.insults.insults.ITerminalTransport,
twisted.conch.telnet.ITelnetTransport, twisted.internet.interfaces.IProcessTransport,
twisted.internet.interfaces.ITCPTransport
Known implementations: twisted.conch.ssh.channel.SSHChannel,
twisted.internet._posixstdio.StandardIO, twisted.internet._win32stdio.StandardIO,
twisted.internet.abstract.FileDescriptor, twisted.internet.iocpreactor.abstract.FileHandle,
twisted.internet.protocol.FileWrapper, twisted.protocols.loopback._LoopbackTransport,
twisted.protocols.loopback.LoopbackRelay
В зависимости от того, куда вы хотите подключиться, вы используете один из них при вызове makeConnection(transport)
, икогда вы делаете это, становится атрибутом протокола.