本文整理汇总了Python中twisted.internet.protocol.Protocol.connectionMade方法的典型用法代码示例。如果您正苦于以下问题:Python Protocol.connectionMade方法的具体用法?Python Protocol.connectionMade怎么用?Python Protocol.connectionMade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.internet.protocol.Protocol
的用法示例。
在下文中一共展示了Protocol.connectionMade方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
"""
overload Protocol.connectionMade to verify that we have a connection
"""
log.msg("ResponseProducerProtocol connectionMade",
logLevel=logging.DEBUG)
Protocol.connectionMade(self)
示例2: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
Protocol.connectionMade(self)
self.transport.setTcpNoDelay(True)
self.buffer = ''
self.nbytes = 0
# XXX send version message
self._handler = self._handle_version, 12
示例3: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
AbstractWind.connectionMade(self)
Protocol.connectionMade(self)
_ = self.transport.getPeer()
_ = (_.host, _.port)
self.peer, self.port = _
示例4: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
self.factory.num_connections += 1
Protocol.connectionMade(self)
self._input = ''
proto_version = ProtocolVersion().serialize()
server_state = ServerState().serialize()
#
self.send(proto_version)
示例5: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
Protocol.connectionMade(self)
self.transport.write(struct.pack('>I', self.__seed))
self._input = ''
self._decompress = None
if self.__decompress:
self._decompress = Decompress()
示例6: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
self.log = util.getLogger("gamespy.login", self)
self.loggedIn = False
def sendKa():
self.sendMsg(MessageFactory.getMessage([("ka", "")]))
self.kaService.alive() ## expects no reply
self.kaService = KeepaliveService(sendKa, 90, self.transport.loseConnection)
Protocol.connectionMade(self)
示例7: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
logger.debug("connectionMade(): %s port %s %s:%s %s",
self.factory.name,
self.factory.local_port,
self.factory.host, self.factory.port,
self.protocol_name)
return Protocol.connectionMade(self)
示例8: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
Protocol.connectionMade(self)
self._conn = self.factory._conn
self.__contacts_list = self.factory._conn.contacts_list
示例9: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
self.isconnected = True
if self.debug:
log.msg("connectionMade")
Protocol.connectionMade(self)
示例10: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
Protocol.connectionMade(self)
self.log = getLogger('gamespy.master', self)
示例11: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
Protocol.connectionMade(self)
示例12: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
Protocol.connectionMade(self)
self.result = {}
示例13: connectionMade
# 需要导入模块: from twisted.internet.protocol import Protocol [as 别名]
# 或者: from twisted.internet.protocol.Protocol import connectionMade [as 别名]
def connectionMade(self):
"""When TCP connection is made, register shutdown handler
"""
Protocol.connectionMade(self)