Re: stop/start client connections with loseConnection in ReconnectingClientFactory

Chris Withers <[email protected]> Fri, 22 Mar 2019 18:54:24 +0000
Newsgroups gmane.comp.python.twisted
Message-ID <[email protected]>
On 22/03/2019 17:08, Chris Satterthwaite wrote:
>                  def clientConnectionLost(self, connector, reason):

Without the rest of your class, it's difficult to see some of the 
potential problems... Could you put it on a gist somewhere?

> 
>                                  print('  factory clientConnectionLost: 
> reason: {}'.format(reason))
> 
>                                  # if self.disconnectedOnPurpose:
> 
>                                  #             ## Hack to keep reactor alive
> 
>                                  #             print('  factory 
> clientConnectionLost: increasing numPorts')
> 
>                                  #             self.numPorts += 1
> 
>                                  #             self.numPortsChanged = True
> 
>                                  #             
> self.disconnectedOnPurpose = False
> 
>                                  print('  ... simulate client going idle 
> before attempting restart...')
> 
>                                  time.sleep(5)

This will block the reactor, so don't think you should be doing it...

cheers,

Chris

_______________________________________________
Twisted-Python mailing list
[email protected]
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python