本文整理汇总了Python中twisted.protocols.policies.ProtocolWrapper.loseConnection方法的典型用法代码示例。如果您正苦于以下问题:Python ProtocolWrapper.loseConnection方法的具体用法?Python ProtocolWrapper.loseConnection怎么用?Python ProtocolWrapper.loseConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.protocols.policies.ProtocolWrapper
的用法示例。
在下文中一共展示了ProtocolWrapper.loseConnection方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dataReceived
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def dataReceived(self, data):
try:
if not self.tlsStarted:
ProtocolWrapper.dataReceived(self, data)
else:
self.fakeSocket.data += data
while self.fakeSocket.data:
AsyncStateMachine.inReadEvent(self)
except TLSError, e:
self.connectionLost(Failure(e))
ProtocolWrapper.loseConnection(self)
示例2: loseConnection
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def loseConnection(self):
"""
Close the connection.
This includes telling the other side we're closing the connection.
If the other side didn't signal that the connection is being closed,
then we might not see their last message, but since their last message
should, according to the spec, be a simple acknowledgement, it
shouldn't be a problem.
"""
# Send a closing frame. It's only polite. (And might keep the browser
# from hanging.)
if not self.disconnecting:
frame = _makeFrame("", _opcode=_CONTROLS.CLOSE)
self.transport.write(frame)
ProtocolWrapper.loseConnection(self)
示例3: loseConnection
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def loseConnection(self):
# XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())?
ProtocolWrapper.loseConnection(self)
示例4: loseConnection
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def loseConnection(self):
self.transport.write('c[3000,"Go away!"]')
ProtocolWrapper.loseConnection(self)
示例5: loseConnection
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def loseConnection(self):
if not self.tlsStarted:
ProtocolWrapper.loseConnection(self)
else:
AsyncStateMachine.setCloseOp(self)
示例6: outReadEvent
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def outReadEvent(self, data):
if data == "":
ProtocolWrapper.loseConnection(self)
else:
ProtocolWrapper.dataReceived(self, data)
示例7: outCloseEvent
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def outCloseEvent(self):
ProtocolWrapper.loseConnection(self)
示例8: connectionMade
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def connectionMade(self):
try:
ProtocolWrapper.connectionMade(self)
except TLSError, e:
self.connectionLost(Failure(e))
ProtocolWrapper.loseConnection(self)
示例9: actuallyLoseConnection
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def actuallyLoseConnection(self):
ProtocolWrapper.loseConnection(self)
示例10: loseConnection
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
def loseConnection(self):
if debug:
print 'TwistedProtocolWrapper.loseConnection'
# XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())?
ProtocolWrapper.loseConnection(self)