Trees | Index | Help |
|
---|
Package twisted :: Package internet :: Module protocol :: Class ReconnectingClientFactory |
|
Factory
--+ |ClientFactory
--+ | ReconnectingClientFactory
ReconnectingPBClientFactory
,
ReconnectingScanFactory
My clients auto-reconnect with an exponential back-off.
Note that clients should call my resetDelay method after they have connected successfully.Method Summary | |
---|---|
Called when a connection has failed to connect. | |
clientConnectionLost(self,
connector,
unused_reason)
| |
Call me after a successful connection to reset. | |
Have this connector connect again, after a suitable delay. | |
I put a stop to any attempt to reconnect in progress. | |
Inherited from ClientFactory :
startedConnecting
Inherited from Factory :
buildProtocol ,
doStart ,
doStop ,
startFactory ,
stopFactory
|
Instance Variable Summary | |
---|---|
float |
factor : a multiplicitive factor by which the delay grows |
float |
initialDelay : Delay for the first reconnection attempt. |
float |
jitter : percentage of randomness to introduce into the delay length to prevent
stampeding. |
int |
maxDelay : Maximum number of seconds between connection attempts. |
Class Variable Summary | |
---|---|
NoneType |
connector = None |
int |
continueTrying = 1 |
float |
delay = 1.0 |
NoneType |
maxRetries = None |
int |
retries = 0 |
Inherited from Factory :
__implemented__ ,
__providedBy__ ,
__provides__ ,
noisy ,
numPorts ,
protocol
|
Method Details |
---|
clientConnectionFailed(self, connector, reason)Called when a connection has failed to connect. It may be useful to call connector.connect() - this will reconnect.
|
resetDelay(self)Call me after a successful connection to reset. I reset the delay and the retry counter. |
retry(self, connector=None)Have this connector connect again, after a suitable delay. |
stopTrying(self)I put a stop to any attempt to reconnect in progress. |
Instance Variable Details |
---|
factora multiplicitive factor by which the delay grows
|
initialDelayDelay for the first reconnection attempt.
|
jitterpercentage of randomness to introduce into the delay length to prevent stampeding.
|
maxDelayMaximum number of seconds between connection attempts.
|
Class Variable Details |
---|
connector
|
continueTrying
|
delay
|
maxRetries
|
retries
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Aug 16 09:55:10 2007 | http://epydoc.sf.net |