class documentation

class twisted.spread.pb.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.

Instance Variable unsafeTracebacks Undocumented
Method __init__
Instance Variable security Undocumented
Method buildProtocol Build the broker instance, passing the security options to it.
Instance Variable rootObjectRequests Undocumented
Method clientConnectionFailed Called when a connection has failed to connect.
Method clientConnectionLost Reconnecting subclasses should call with reconnecting=1.
Method clientConnectionMade Undocumented
Method getRootObject Get root object of remote PB server.
Method disconnect If the factory is connected, close the connection.
Method login Login and get perspective from remote PB server.
Method _reset Undocumented
Instance Variable _broker Undocumented
Instance Variable _root Undocumented
Method _failAll Undocumented
Method _cbSendUsername Undocumented
Method _cbResponse Undocumented
Method _cbLoginAnonymous Attempt an anonymous login on the given remote root object.

Inherited from ClientFactory:

Method startedConnecting Called when a connection has been started.

Inherited from Factory (via ClientFactory):

Class Variable protocol Undocumented
Instance Variable numPorts Undocumented
Class Variable noisy Undocumented
Class Method forProtocol Create a factory for the given protocol.
Method logPrefix Describe this factory for log messages.
Method doStart Make sure startFactory is called.
Method doStop Make sure stopFactory is called.
Method startFactory This will be called before I begin listening on a Port or Connector.
Method stopFactory This will be called before I stop listening on all Ports/Connectors.
unsafeTracebacks = (source)

Undocumented

def __init__(self, unsafeTracebacks=False, security=globalSecurity): (source)
ParametersunsafeTracebacksif set, tracebacks for exceptions will be sent over the wire. (type: bool)
securitysecurity options used by the broker, default to globalSecurity. (type: twisted.spread.jelly.SecurityOptions)
security = (source)

Undocumented

def buildProtocol(self, addr): (source)

Build the broker instance, passing the security options to it.

def _reset(self): (source)

Undocumented

rootObjectRequests = (source)

Undocumented

(type: list)
_broker = (source)

Undocumented

_root = (source)

Undocumented

def _failAll(self, reason): (source)

Undocumented

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.

ParametersconnectorUndocumented
reasonUndocumented (type: twisted.python.failure.Failure)
def clientConnectionLost(self, connector, reason, reconnecting=0): (source)

Reconnecting subclasses should call with reconnecting=1.

def clientConnectionMade(self, broker): (source)

Undocumented

def getRootObject(self): (source)

Get root object of remote PB server.

ReturnsDeferred of the root object.
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 _cbSendUsername(self, root, username, password, client): (source)

Undocumented

def _cbResponse(self, challenges, password, client): (source)

Undocumented

def _cbLoginAnonymous(self, root, client): (source)

Attempt an anonymous login on the given remote root object.

ParametersrootThe object on which to attempt the login, most likely returned by a call to PBClientFactory.getRootObject. (type: RemoteReference)
clientA jellyable object which will be used as the mind parameter for the login attempt.
ReturnsA Deferred which will be called back with a RemoteReference to an avatar when anonymous login succeeds, or which will errback if anonymous login fails. (type: Deferred)
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}
ReturnsA Deferred which will be called back with a RemoteReference for the avatar logged in to, or which will errback if login fails. (type: Deferred)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.