本文整理汇总了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()
示例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 = []
示例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()
示例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())
示例5: outConnectEvent
# 需要导入模块: from twisted.protocols.policies import ProtocolWrapper [as 别名]
# 或者: from twisted.protocols.policies.ProtocolWrapper import connectionMade [as 别名]
def outConnectEvent(self):
ProtocolWrapper.connectionMade(self)
示例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)
示例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()