Class ReconnectingPBClientFactory
source code
twisted.internet.protocol.Factory --+
|
twisted.internet.protocol.ClientFactory --+
|
twisted.spread.pb.PBClientFactory --+
|
twisted.internet.protocol.Factory --+ |
| |
twisted.internet.protocol.ClientFactory --+ |
| |
twisted.internet.protocol.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).
Inherited from twisted.spread.pb.PBClientFactory :
protocol
|
|
|
|
|
|
|
|
|
|
|
|
|
|
startGettingPerspective(self,
username,
password,
serviceName,
perspectiveName=None,
client=None) |
source code
|
|
|
|
|
|
|
|
|
|
|
gotPerspective(self,
perspective)
The remote avatar or perspective (obtained each time this factory
connects) is now available. |
source code
|
|
|
gotRootObject(self,
root)
The remote root object (obtained each time this factory connects)
is now available. |
source code
|
|
|
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. |
source code
|
|
Inherited from twisted.spread.pb.PBClientFactory :
disconnect ,
getRootObject
Inherited from twisted.spread.pb.PBClientFactory (private):
_cbResponse ,
_cbSendUsername ,
_failAll ,
_reset
Inherited from twisted.internet.protocol.ClientFactory :
startedConnecting
Inherited from twisted.internet.protocol.Factory :
__providedBy__ ,
buildProtocol ,
doStart ,
doStop ,
startFactory ,
stopFactory
Inherited from twisted.internet.protocol.ReconnectingClientFactory :
resetDelay ,
retry ,
stopTrying
|
Inherited from twisted.spread.pb.PBClientFactory :
unsafeTracebacks
Inherited from twisted.internet.protocol.Factory :
__implemented__ ,
__provides__ ,
noisy ,
numPorts
Inherited from twisted.internet.protocol.ReconnectingClientFactory :
connector ,
continueTrying ,
delay ,
maxRetries ,
retries
Inherited from twisted.internet.protocol.ReconnectingClientFactory (private):
_callID
|
Inherited from twisted.internet.protocol.ReconnectingClientFactory :
factor ,
initialDelay ,
jitter ,
maxDelay
|
- Overrides:
twisted.spread.pb.PBClientFactory.__init__
|
clientConnectionFailed(self,
connector,
reason)
| source code
|
- Overrides:
twisted.spread.pb.PBClientFactory.clientConnectionFailed
|
clientConnectionLost(self,
connector,
reason)
| source code
|
Reconnecting subclasses should call with reconnecting=1.
- Overrides:
twisted.spread.pb.PBClientFactory.clientConnectionLost
- (inherited documentation)
|
- Overrides:
twisted.spread.pb.PBClientFactory.clientConnectionMade
|
Login and get perspective from remote PB server.
Currently only credentials implementing twisted.cred.credentials.IUsernamePassword are
supported.
- Returns:
- Deferred of RemoteReference to the perspective.
- Overrides:
twisted.spread.pb.PBClientFactory.login
- (inherited documentation)
|
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.
|