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


Python ProtocolWrapper.connectionMade方法代码示例

本文整理汇总了Python中twisted.protocols.policies.ProtocolWrapper.connectionMade方法的典型用法代码示例。如果您正苦于以下问题:Python ProtocolWrapper.connectionMade方法的具体用法?Python ProtocolWrapper.connectionMade怎么用?Python ProtocolWrapper.connectionMade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twisted.protocols.policies.ProtocolWrapper的用法示例。


在下文中一共展示了ProtocolWrapper.connectionMade方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: dataReceived

# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionMade [as 别名]
    def dataReceived(self, data):
        """
        Append the data to the buffer list and parse the whole.
        """
        self._buffer.append(data)

        if self.challenge:
            buf = "".join(self._buffer)
            if len(buf) >= 8:
                challenge, buf = buf[:8], buf[8:]
                self._buffer = [buf]
                nonce = self.challenge(challenge)
                self.transport.write(nonce)
                self.challenge = None
                if self.connected:
                    ProtocolWrapper.connectionMade(self)
                self.dataReceived("") # Kick it off proper
                if self.pending_dc:
                    self.pending_dc = False
                    self.loseConnection()
        else:
            self._parseFrames()
            if self._pending_frames:
                self._sendFrames()

        self._parseFrames()
开发者ID:DesertBus,项目名称:sockjs-twisted,代码行数:28,代码来源:oldwebsockets.py

示例2: connectionMade

# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionMade [as 别名]
 def connectionMade(self):
     """
     Log the new connection and initialize the buffer list.
     """
     ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())
     self._buffer = []
开发者ID:Fugiman,项目名称:sockjs-twisted,代码行数:9,代码来源:websockets.py

示例3: connectionMade

# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionMade [as 别名]
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     if self.tlsStarted and self.isClient and not self.helloDone:
         self._clientHello()
开发者ID:appknox,项目名称:m2crypto,代码行数:6,代码来源:TwistedProtocolWrapper.py

示例4: connectionMade

# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionMade [as 别名]
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())
开发者ID:djmitche,项目名称:concurrency,代码行数:5,代码来源:websocket.py

示例5: outConnectEvent

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

示例6: connectionMade

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

示例7: connectionMade

# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionMade [as 别名]
 def connectionMade(self):
     if debug:
         print 'TwistedProtocolWrapper.connectionMade'
     ProtocolWrapper.connectionMade(self)
     if self.tlsStarted and self.isClient and not self.helloDone:
         self._clientHello()
开发者ID:mikedougherty,项目名称:M2Crypto,代码行数:8,代码来源:TwistedProtocolWrapper.py


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