本文整理汇总了Python中twisted.protocols.policies.ProtocolWrapper.connectionLost方法的典型用法代码示例。如果您正苦于以下问题:Python ProtocolWrapper.connectionLost方法的具体用法?Python ProtocolWrapper.connectionLost怎么用?Python ProtocolWrapper.connectionLost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.protocols.policies.ProtocolWrapper
的用法示例。
在下文中一共展示了ProtocolWrapper.connectionLost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: connectionLost
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionLost [as 别名]
def connectionLost(self, reason):
# type: (AnyStr) -> None
# reason = [Failure instance: Traceback (failure with no
# frames): <class 'twisted.internet.error.ConnectionDone'>:
# Connection was closed cleanly. ] (<type 'instance'>)
self.clear()
ProtocolWrapper.connectionLost(self, reason)
示例2: connectionLost
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionLost [as 别名]
def connectionLost(self, reason):
"""
Handle the possible repetition of calls to this method (due to either
the underlying transport going away or due to an error at the TLS
layer) and make sure the base implementation only gets invoked once.
"""
if not self._lostTLSConnection:
# Tell the TLS connection that it's not going to get any more data
# and give it a chance to finish reading.
self._tlsConnection.bio_shutdown()
self._flushReceiveBIO()
self._lostTLSConnection = True
reason = self._reason or reason
self._reason = None
ProtocolWrapper.connectionLost(self, reason)
示例3: connectionLost
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionLost [as 别名]
def connectionLost(self, reason):
if not self.connectionLostCalled:
ProtocolWrapper.connectionLost(self, reason)
self.connectionLostCalled = True
示例4: connectionLost
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionLost [as 别名]
def connectionLost(self, reason):
if debug:
print 'TwistedProtocolWrapper.connectionLost'
self.clear()
ProtocolWrapper.connectionLost(self, reason)