Trees | Index | Help |
|
---|
Package ZenUtils :: Module PBUtil :: Class ReconnectingPBClientFactory |
|
Factory
--+ |ClientFactory
--+ |PBClientFactory
--+ |Factory
--+ | | |ClientFactory
--+ | | |ReconnectingClientFactory
--+ | ReconnectingPBClientFactory
Reconnecting client factory for PB brokers.
Like PBClientFactory, but if the connection fails or is lost, the factory will attempt to reconnect.
Instead of using f.getRootObject (which gives a Deferred that can only be fired once), override the gotRootObject method.
Instead of using the newcred f.login (which is also one-shot), call f.startLogin() with the credentials and client, and override the gotPerspective method.
Instead of using the oldcred f.getPerspective (also one-shot), call f.startGettingPerspective() with the same arguments, and override gotPerspective.
gotRootObject and gotPerspective will be called each time the object is received (once per successful connection attempt). You will probably want to use obj.notifyOnDisconnect to find out when the connection is lost.
If an authorization error occurs, failedToGetPerspective() will be invoked.
To use me, subclass, then hand an instance to a connector (like TCPClient).Method Summary | |
---|---|
__init__(self)
| |
__getstate__(self)
| |
Called when a connection has failed to connect. | |
clientConnectionLost(self,
connector,
reason)
| |
clientConnectionMade(self,
broker)
| |
doGetPerspective(self,
root)
| |
doLogin(self,
root)
| |
The login process failed, most likely because of an authorization failure (bad password), but it is also possible that we lost the new connection before we managed to send our credentials. | |
getPerspective(self,
*args)
| |
The remote avatar or perspective (obtained each time this factory connects) is now available. | |
The remote root object (obtained each time this factory connects) is now available. | |
login(self,
*args)
| |
startGettingPerspective(self,
username,
password,
serviceName,
perspectiveName,
client)
| |
startLogin(self,
credentials,
client)
| |
Inherited from PBClientFactory :
disconnect ,
getRootObject ,
_cbResponse ,
_cbSendUsername ,
_failAll ,
_reset
Inherited from ReconnectingClientFactory :
resetDelay ,
retry ,
stopTrying
Inherited from ClientFactory :
startedConnecting
Inherited from Factory :
buildProtocol ,
doStart ,
doStop ,
startFactory ,
stopFactory
|
Instance Variable Summary | |
---|---|
Inherited from ReconnectingClientFactory :
factor ,
initialDelay ,
jitter ,
maxDelay
|
Class Variable Summary | |
---|---|
Inherited from PBClientFactory :
unsafeTracebacks
Inherited from ReconnectingClientFactory :
connector ,
continueTrying ,
delay ,
maxRetries ,
retries ,
_callID
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.
|
failedToGetPerspective(self, why)The login process failed, most likely because of an authorization failure (bad password), but it is also possible that we lost the new connection before we managed to send our credentials. |
gotPerspective(self, perspective)The remote avatar or perspective (obtained each time this factory connects) is now available. |
gotRootObject(self, root)The remote root object (obtained each time this factory connects) is now available. This method will be called each time the connection is established and the object reference is retrieved. |
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Aug 16 09:55:10 2007 | http://epydoc.sf.net |