本文整理汇总了Python中twisted.protocols.basic.LineReceiver.connectionMade方法的典型用法代码示例。如果您正苦于以下问题:Python LineReceiver.connectionMade方法的具体用法?Python LineReceiver.connectionMade怎么用?Python LineReceiver.connectionMade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.protocols.basic.LineReceiver
的用法示例。
在下文中一共展示了LineReceiver.connectionMade方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
ProcessProtocol.connectionMade(self)
LineReceiver.connectionMade(self)
self.transport.disconnecting = False #erm. Needs this to fix a bug in Twisted?
self.send_to_client("hello", [self.communicator.mod.name])
if not self.messages_not_acknowledged:
self.client_started_processing_at = time.time()
self.messages_not_acknowledged += 1
示例2: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
"""
Notify our factory that we're ready to accept connections.
"""
LineReceiver.connectionMade(self)
if self.factory.deferred is not None:
self.factory.deferred.callback(self)
self.factory.deferred = None
示例3: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
LineReceiver.connectionMade(self)
self.transport_connected = True
self.log("Transport connected")
示例4: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
""" Initialize connection """
LineReceiver.connectionMade(self)
#reactor.callLater(0, algo_schedule)
on_connection()
print "Connection made..."
示例5: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
LineReceiver.connectionMade(self)
self.sendLine("list")
示例6: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
LineReceiver.connectionMade(self)
print "server connected"
示例7: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
LineReceiver.connectionMade(self)
self.subscriber = Subscriber(self)
示例8: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
LineReceiver.connectionMade(self)
print 'thruster', self.thruster_id, 'connection made'
示例9: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
print "a new client connected ..."
LineReceiver.connectionMade(self)
self.factory.clients.append(self)
示例10: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
LineReceiver.connectionMade(self)
self.state = STATES.LOGGING_IN
self.login()
示例11: connectionMade
# 需要导入模块: from twisted.protocols.basic import LineReceiver [as 别名]
# 或者: from twisted.protocols.basic.LineReceiver import connectionMade [as 别名]
def connectionMade(self):
self._host = self.transport.getHost().host
logger.debug("{} connected".format(self.host))
LineReceiver.connectionMade(self)