class documentation

class PBClientFactory(protocol.ClientFactory): (source)

View In Hierarchy

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 __init__
Method build​Protocol Build the broker instance, passing the security options to it.
Method client​Connection​Failed Called when a connection has failed to connect.
Method client​Connection​Lost Reconnecting subclasses should call with reconnecting=1.
Method client​Connection​Made Undocumented
Method disconnect If the factory is connected, close the connection.
Method get​Root​Object Get root object of remote PB server.
Method login Login and get perspective from remote PB server.
Instance Variable root​Object​Requests Undocumented
Instance Variable security Undocumented
Instance Variable unsafe​Tracebacks Undocumented
Method _cb​Login​Anonymous Attempt an anonymous login on the given remote root object.
Method _cb​Response Undocumented
Method _cb​Send​Username Undocumented
Method _fail​All Undocumented
Method _reset Undocumented
Instance Variable _broker Undocumented
Instance Variable _root Undocumented

Inherited from ClientFactory:

Method started​Connecting Called when a connection has been started.

Inherited from Factory (via ClientFactory):

Class Method for​Protocol Create a factory for the given protocol.
Method do​Start Make sure startFactory is called.
Method do​Stop Make sure stopFactory is called.
Method log​Prefix Describe this factory for log messages.
Method start​Factory This will be called before I begin listening on a Port or Connector.
Method stop​Factory This will be called before I stop listening on all Ports/Connectors.
Class Variable noisy Undocumented
Class Variable protocol Undocumented
Instance Variable num​Ports Undocumented
def __init__(self, unsafeTracebacks=False, security=globalSecurity): (source)
Parameters
unsafe​Tracebacks:boolif set, tracebacks for exceptions will be sent over the wire.
security:twisted.spread.jelly.SecurityOptionssecurity options used by the broker, default to globalSecurity.
def buildProtocol(self, addr): (source)
Build the broker instance, passing the security options to it.
def clientConnectionFailed(self, connector, reason): (source)

Called when a connection has failed to connect.

It may be useful to call connector.connect() - this will reconnect.

Parameters
connectorUndocumented
reason:twisted.python.failure.FailureUndocumented
def clientConnectionLost(self, connector, reason, reconnecting=0): (source)
Reconnecting subclasses should call with reconnecting=1.
def clientConnectionMade(self, broker): (source)

Undocumented

def disconnect(self): (source)

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.

def getRootObject(self): (source)
Get root object of remote PB server.
Returns
Deferred of the root object.
def login(self, credentials, client=None): (source)

Login and get perspective from remote PB server.

Currently the following credentials are supported:

    L{twisted.cred.credentials.IUsernamePassword}
    L{twisted.cred.credentials.IAnonymous}
Returns
DeferredA Deferred which will be called back with a RemoteReference for the avatar logged in to, or which will errback if login fails.
rootObjectRequests: list = (source)

Undocumented

security = (source)

Undocumented

unsafeTracebacks = (source)

Undocumented

def _cbLoginAnonymous(self, root, client): (source)
Attempt an anonymous login on the given remote root object.
Parameters
root:RemoteReferenceThe object on which to attempt the login, most likely returned by a call to PBClientFactory.getRootObject.
clientA jellyable object which will be used as the mind parameter for the login attempt.
Returns
DeferredA Deferred which will be called back with a RemoteReference to an avatar when anonymous login succeeds, or which will errback if anonymous login fails.
def _cbResponse(self, challenges, password, client): (source)

Undocumented

def _cbSendUsername(self, root, username, password, client): (source)

Undocumented

def _failAll(self, reason): (source)

Undocumented

def _reset(self): (source)

Undocumented

_broker = (source)

Undocumented

_root = (source)

Undocumented