Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`internet`.`protocol`.`ClientCreator``

class documentation

`class ClientCreator: (source)`

View In Hierarchy

Client connections that do not require a factory.

The various connect* methods create a protocol instance using the given protocol class and arguments, and connect it, returning a Deferred of the resulting protocol instance.

Useful for cases when we don't really need a factory. Mainly this is when there is no shared state between protocol instances, and no need to reconnect.

The `connectTCP`, `connectUNIX`, and `connectSSL` methods each return a `Deferred` which will fire with an instance of the protocol class passed to `ClientCreator.__init__`. These Deferred can be cancelled to abort the connection attempt (in a very unlikely case, cancelling the Deferred may not prevent the protocol from being instantiated and connected to a transport; if this happens, it will be disconnected immediately afterwards and the Deferred will still errback with `CancelledError`).

Method | `__init__` | Undocumented
Method | `connectSSL` | Connect to an SSL server.
Method | `connectTCP` | Connect to a TCP server.
Method | `connectUNIX` | Connect to a Unix socket.
Instance Variable | `args` | Undocumented
Instance Variable | `kwargs` | Undocumented
Instance Variable | `protocolClass` | Undocumented
Instance Variable | `reactor` | Undocumented
Method | `_connect` | Initiate a connection attempt.

def __init__(self, reactor, protocolClass, *args, **kwargs): (source)

Undocumented

def connectSSL(self, host, port, contextFactory, timeout=30, bindAddress=None): (source)

Connect to an SSL server.

The parameters are all the same as to `IReactorSSL.connectSSL` except that the factory parameter is omitted.

Returns
A `Deferred` which fires with an instance of the protocol class passed to this `ClientCreator`'s initializer or fails if the connection cannot be set up for some reason.

def connectTCP(self, host, port, timeout=30, bindAddress=None): (source)

Connect to a TCP server.

The parameters are all the same as to `IReactorTCP.connectTCP` except that the factory parameter is omitted.

Returns
A `Deferred` which fires with an instance of the protocol class passed to this `ClientCreator`'s initializer or fails if the connection cannot be set up for some reason.

def connectUNIX(self, address, timeout=30, checkPID=False): (source)

Connect to a Unix socket.

The parameters are all the same as to `IReactorUNIX.connectUNIX` except that the factory parameter is omitted.

Returns
A `Deferred` which fires with an instance of the protocol class passed to this `ClientCreator`'s initializer or fails if the connection cannot be set up for some reason.

args = (source)

Undocumented

kwargs = (source)

Undocumented

protocolClass = (source)

Undocumented

reactor = (source)

Undocumented

def _connect(self, method, *args, **kwargs): (source)

Initiate a connection attempt.

Parameters
method | A callable which will actually start the connection attempt. For example, `reactor.connectTCP`.
*args | Positional arguments to pass to `method`, excluding the factory.
**kwargs | Keyword arguments to pass to `method`.
Returns
A `Deferred` which fires with an instance of the protocol class passed to this `ClientCreator`'s initializer or fails if the connection cannot be set up for some reason.