ClientService maintains a single outgoing connection to a client endpoint, reconnecting after a configurable timeout when a connection fails, either before or after connecting.
|Method||whenConnected||Retrieve the currently-connected
|Method||stopService||Stop attempting to reconnect and close any existing connections.|
Inherited from Service:
|Method||setName||Set the name of the service.|
|Method||setServiceParent||Set the parent of the service. This method is responsible for setting the
|Method||disownServiceParent||Use this API to remove an
|Method||privilegedStartService||Do preparation work for starting the service.|
|retryPolicy||A policy configuring how long |
|clock||The clock used to schedule reconnection. It's mainly useful to be parametrized in tests. If the factory is serialized, this attribute will not be serialized, and the default value (the reactor) will be restored when deserialized. (type: |
|prepareConnection||A single argument |
Present Since Twisted 18.7.0(type:
Retrieve the currently-connected
Protocol, or the next one to connect.
|Parameters||failAfterFailures||number of connection failures after which the Deferred will deliver a Failure (None means the Deferred will only fail if/when the service is stopped). Set this to 1 to make the very first connection failure signal an error. Use 2 to allow one failure but signal an error if the subsequent retry then fails. (type: |
|Returns||a Deferred that fires with a protocol produced by the factory passed to |