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


Python ClientFactory.clientConnectionFailed方法代码示例

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


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

示例1: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     self.clientProxy.nodeLocator.remove(self.address)
     if hasattr(self, 'deferred') and not self.deferred.called:
         self.reactor.callLater(0, self.deferred.errback, reason)
         del self.deferred
     ClientFactory.clientConnectionFailed(
             self, connector, reason)
开发者ID:dpnova,项目名称:txmemcache,代码行数:9,代码来源:client.py

示例2: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     logger.info('connection failed: %s', reason.getErrorMessage())
     ClientFactory.clientConnectionFailed(self, connector, reason)
     if self.reconnect:
         time.sleep(self.reconnect_delay)
         connector.connect()
     elif not self.protocols:
         if self.onFinish:
             self.onFinish.callback(None)
开发者ID:harnettlab,项目名称:sllurp,代码行数:11,代码来源:llrp.py

示例3: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     logging.info('Connection failed')
     ClientFactory.clientConnectionFailed(self, connector, reason)
     #If first connection was failed - try to start server
     if not self.reconnect:
         #Start, reconnect
         try:
             subprocess.Popen(['python', 'server.py']).wait()
         except Exception, err:
             logging.exception('Error starting server: %s', err)
         time.sleep(3)
         do_connect(self.listener, True)
开发者ID:kvj,项目名称:mp-twisted,代码行数:14,代码来源:clientconnection.py

示例4: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     logger.info('connection failed: {}'.format(reason))
     ClientFactory.clientConnectionFailed(self, connector, reason)
     if self.reconnect:
         reactor.callFromThread(time.sleep, self.reconnect_delay)
         connector.connect()
     else:
         if self.standalone:
             try:
                 reactor.callFromThread(reactor.stop)
             except ReactorNotRunning:
                 pass
开发者ID:,项目名称:,代码行数:14,代码来源:

示例5: connect

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def connect(self, host, port):
     self._connection_timeout = self.timeout
     self._stack_conn = _Connection()
     self._stack_conn.attach(self)
     self._stack_conn.connect_cb = Callback()
     factory = ClientFactory()
     factory.protocol = lambda: self._stack_conn
     factory.clientConnectionFailed = self.clientConnectionFailed
     self._connect_to_reactor(host, port, factory, self._connection_timeout)
     yield self._stack_conn.connect_cb
开发者ID:sah,项目名称:monocle,代码行数:12,代码来源:__init__.py

示例6: connect

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def connect(self, host, port):
     self._stack_conn = _Connection()
     self._stack_conn.attach(self)
     self._stack_conn.connect_cb = Callback()
     factory = ClientFactory()
     factory.protocol = lambda: self._stack_conn
     factory.clientConnectionFailed = self.clientConnectionFailed
     if self.ssl_options is not None:
         reactor.connectSSL(host, port, factory,
                            SSLContextFactory(self.ssl_options))
     else:
         reactor.connectTCP(host, port, factory)
     yield self._stack_conn.connect_cb
开发者ID:pombredanne,项目名称:monocle,代码行数:15,代码来源:__init__.py

示例7: getYobotPurpleFactory

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def getYobotPurpleFactory(self):
     f = ClientFactory()
     f.protocol = YobotPurple
     f.setPurple = self.setPurple
     f.doRegister = self.purpleDoRegister
     f.dispatch = self.purple_dispatch
     #...
     f.attempts = 0
     max_attempts = 5
     def clientConnectionFailed(connector, reason):
         log_err("Attempt %d/%d failed: %s" % (f.attempts, max_attempts, reason))
         if f.attempts < max_attempts:
             log_info("trying again in 1.5 secs")
             reactor.callLater(1.5, connector.connect)
             f.attempts += 1
     
     f.clientConnectionFailed = clientConnectionFailed
     return f
开发者ID:mnunberg,项目名称:yobot,代码行数:20,代码来源:yobotnet.py

示例8: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     log.err(reason, 'Connection failed')
     ClientFactory.clientConnectionFailed(self, connector, reason)
开发者ID:AndrewCvekl,项目名称:vumi,代码行数:5,代码来源:client.py

示例9: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     """ """
     print 'client connection failed'
     ClientFactory.clientConnectionFailed(self, connector, reason)
     self.controller.completed.errback(reason)
开发者ID:alexa816,项目名称:OneDir,代码行数:7,代码来源:serverConnections.py

示例10: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     ClientFactory.clientConnectionFailed(self, connector, reason)
     e = Event('connection-result', succeeded = False, reason = reason)
     self.event_func(e)
开发者ID:freedesktop-unofficial-mirror,项目名称:ytstenut__ytstenut-plugins,代码行数:6,代码来源:xmppstream.py

示例11: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     logger.debug("%s: BaseClient::clientConnectionFailed(): %s",
                  self.protocol_name, reason)
     self.session = None
     return ClientFactory.clientConnectionFailed(self, connector, reason)
开发者ID:da4089,项目名称:robot-nps,代码行数:7,代码来源:base.py

示例12: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     self.log_error("Unable to connect to APN feedback server: %s" %
         (reason,))
     self.connected = False
     ClientFactory.clientConnectionFailed(self, connector, reason)
开发者ID:azbarcea,项目名称:calendarserver,代码行数:7,代码来源:applepush.py

示例13: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
 def clientConnectionFailed(self, connector, reason):
     ClientFactory.clientConnectionFailed(self, connector, reason)
开发者ID:fubendong,项目名称:pycoin,代码行数:4,代码来源:BitcoinProtocol.py

示例14: clientConnectionFailed

# 需要导入模块: from twisted.internet.protocol import ClientFactory [as 别名]
# 或者: from twisted.internet.protocol.ClientFactory import clientConnectionFailed [as 别名]
	def clientConnectionFailed(self, connector, reason):
		print "serverConnectionFailed", reason
		ClientFactory.clientConnectionFailed(self, connector, reason)
		self.controller.completed.errback(reason)
开发者ID:lidio601,项目名称:multipart-file-transfer,代码行数:6,代码来源:remotesyncpart.py


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