当前位置: 首页>>代码示例>>Python>>正文


Python ProtocolWrapper.loseConnection方法代码示例

本文整理汇总了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)
开发者ID:20after4,项目名称:Yaki,代码行数:13,代码来源:TLSTwistedProtocolWrapper.py

示例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)
开发者ID:Fugiman,项目名称:sockjs-twisted,代码行数:20,代码来源:websockets.py

示例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)
开发者ID:appknox,项目名称:m2crypto,代码行数:5,代码来源:TwistedProtocolWrapper.py

示例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)
开发者ID:Fugiman,项目名称:sockjs-twisted,代码行数:5,代码来源:websocket.py

示例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)
开发者ID:20after4,项目名称:Yaki,代码行数:7,代码来源:TLSTwistedProtocolWrapper.py

示例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)
开发者ID:20after4,项目名称:Yaki,代码行数:7,代码来源:TLSTwistedProtocolWrapper.py

示例7: outCloseEvent

# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
 def outCloseEvent(self):
     ProtocolWrapper.loseConnection(self)
开发者ID:20after4,项目名称:Yaki,代码行数:4,代码来源:TLSTwistedProtocolWrapper.py

示例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)
开发者ID:20after4,项目名称:Yaki,代码行数:8,代码来源:TLSTwistedProtocolWrapper.py

示例9: actuallyLoseConnection

# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import loseConnection [as 别名]
 def actuallyLoseConnection(self):
     ProtocolWrapper.loseConnection(self)
开发者ID:inglesp,项目名称:async-intro,代码行数:4,代码来源:slowserver.py

示例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)
开发者ID:mikedougherty,项目名称:M2Crypto,代码行数:7,代码来源:TwistedProtocolWrapper.py


注:本文中的twisted.protocols.policies.ProtocolWrapper.loseConnection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。