我是Twisted的初学者。最近,我在读《Twisted Network Programming Essentials》一书,本书中的示例2-3如下:
class QuickDisconnectProtocol(protocol.Protocol):
def connectionMade(self):
print "Connected to %s." % self.transport.getPeer( ).host
self.transport.loseConnection( )
================================
self.transport.loseConnection( )
会员“交通”在哪里? 我在协议里找不到那个。在
同样的问题,当谈到Ex2-4。。。在
有人知道如何阅读扭曲的文档吗?谢谢!在
传输是到您正在使用的任何东西(如telnet、SSH、文件等)的连接
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
^{pr2}$根据您想连接到的位置,您可以在调用
makeConnection(transport)
时使用其中一个,当您这样做时,将成为协议的一个属性。在相关问题 更多 >
编程相关推荐