Package twisted :: Package spread :: Module pb :: Class PBClientFactory
[show private | hide private]
[frames | no frames]

Class PBClientFactory

  Factory --+    
            |    
ClientFactory --+
                |
               PBClientFactory

Known Subclasses:
ReconnectingPBClientFactory

Client factory for PB brokers.

As with all client factories, use with reactor.connectTCP/SSL/etc.. getPerspective and getRootObject can be called either before or after the connect.
Method Summary
  __init__(self)
  clientConnectionFailed(self, connector, reason)
Called when a connection has failed to connect.
  clientConnectionLost(self, connector, reason, reconnecting)
Reconnecting subclasses should call with reconnecting=1.
  clientConnectionMade(self, broker)
  disconnect(self)
If the factory is connected, close the connection.
  getRootObject(self)
Get root object of remote PB server.
  login(self, credentials, client)
Login and get perspective from remote PB server.
Inherited from ClientFactory: startedConnecting
Inherited from Factory: buildProtocol, doStart, doStop, startFactory, stopFactory

Class Variable Summary
classobj protocol = twisted.spread.pb.Broker
int unsafeTracebacks = 0                                                                     
Inherited from Factory: __implemented__, __providedBy__, __provides__, noisy, numPorts

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.
Parameters:
reason
           (type=twisted.python.failure.Failure)
Overrides:
twisted.internet.protocol.ClientFactory.clientConnectionFailed (inherited documentation)

clientConnectionLost(self, connector, reason, reconnecting=0)

Reconnecting subclasses should call with reconnecting=1.
Overrides:
twisted.internet.protocol.ClientFactory.clientConnectionLost

disconnect(self)

If the factory is connected, close the connection.

Note that if you set up the factory to reconnect, you will need to implement extra logic to prevent automatic reconnection after this is called.

getRootObject(self)

Get root object of remote PB server.
Returns:
Deferred of the root object.

login(self, credentials, client=None)

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.

Class Variable Details

unsafeTracebacks

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Thu Aug 16 09:55:14 2007 http://epydoc.sf.net