class MyClientFactory(MyProtocolFactoryMixin, protocol.ClientFactory): (source)
Known subclasses: twisted.test.test_tcp.ClientStartStopFactory
Client factory which creates AccumulatingProtocol
instances.
Method | __init__ |
Undocumented |
Method | client |
Called when a connection has failed to connect. |
Method | client |
Called when an established connection is lost. |
Method | stop |
This will be called before I stop listening on all Ports/Connectors. |
Instance Variable | deferred |
Undocumented |
Instance Variable | fail |
Undocumented |
Instance Variable | failed |
Undocumented |
Instance Variable | lost |
Undocumented |
Instance Variable | reason |
Undocumented |
Instance Variable | stopped |
Undocumented |
Inherited from MyProtocolFactoryMixin
:
Method | build |
Create a AccumulatingProtocol and set it up to be able to perform callbacks. |
Instance Variable | called |
A counter which is incremented each time buildProtocol is called. |
Instance Variable | peer |
A list of the addresses passed to buildProtocol. |
Instance Variable | protocol |
The most recently created AccumulatingProtocol instance which was returned from buildProtocol. |
Instance Variable | protocol |
When an instance of AccumulatingProtocol is created, this will be set as its closedDeferred attribute and then this attribute will be set to None so the defer.Deferred is not used by more than one protocol. |
Instance Variable | protocol |
When an instance of AccumulatingProtocol is connected, if this is not None , the Deferred will be called back with the protocol instance and the attribute set to None . |
Instance Variable | protocol |
Factory for protocols - takes the place of the typical protocol attribute of factories (but that name is used by this class for something else). |
Inherited from ClientFactory
(via MyProtocolFactoryMixin
):
Method | started |
Called when a connection has been started. |
Inherited from Factory
(via MyProtocolFactoryMixin
, ClientFactory
):
Class Method | for |
Create a factory for the given protocol. |
Method | do |
Make sure startFactory is called. |
Method | do |
Make sure stopFactory is called. |
Method | log |
Describe this factory for log messages. |
Method | start |
This will be called before I begin listening on a Port or Connector. |
Class Variable | noisy |
Undocumented |
Instance Variable | num |
Undocumented |
Called when a connection has failed to connect.
It may be useful to call connector.connect() - this will reconnect.
Parameters | |
connector | Undocumented |
reason:twisted.python.failure.Failure | Undocumented |
Called when an established connection is lost.
It may be useful to call connector.connect() - this will reconnect.
Parameters | |
connector | Undocumented |
reason:twisted.python.failure.Failure | Undocumented |
twisted.test.test_tcp.ClientStartStopFactory
This will be called before I stop listening on all Ports/Connectors.
This can be overridden to perform 'shutdown' tasks such as disconnecting database connections, closing files, etc.
It will be called, for example, before an application shuts down, if it was connected to a port. User code should not call this function directly.