twisted.internet.endpoints._WrappingFactory(ClientFactory) class documentationtwisted.internet.endpoints
(View In Hierarchy)
Wrap a factory in order to wrap the protocols it builds.
| Method | __init__ | |
| Method | startedConnecting | A connection attempt was started. Remember the connector which started said attempt, for use later. | 
| Method | doStart | Start notifications are passed straight through to the wrapped factory. | 
| Method | doStop | Stop notifications are passed straight through to the wrapped factory. | 
| Method | buildProtocol | Proxy buildProtocolto ourself._wrappedFactoryor errback theself._onConnectionDeferredif 
the wrapped factory raises an exception or returnsNone. | 
| Method | clientConnectionFailed | Errback the self._onConnectionDeferredwhen 
the client connection fails. | 
| Instance Variable | _wrappedFactory | A provider of IProtocolFactory whose buildProtocol method will be called and whose resulting protocol will be wrapped. | 
| Instance Variable | _onConnection | A Deferredthat fires when the protocol is connected | 
| Instance Variable | _connector | A connectorthat is managing the current or previous connection attempt. | 
| Method | _canceller | The outgoing connection attempt was cancelled.  Fail that Deferredwith 
anerror.ConnectingCancelledError. | 
Inherited from ClientFactory:
| Method | clientConnectionLost | Called when an established connection is lost. | 
Inherited from Factory (via ClientFactory):
| Class Method | forProtocol | Create a factory for the given protocol. | 
| Method | logPrefix | Describe this factory for log messages. | 
| 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. | 
| Parameters | wrappedFactory | A provider of IProtocolFactory whose buildProtocol method will be called and whose resulting protocol will be wrapped. | 
A connection attempt was started. Remember the connector which started said attempt, for use later.
The outgoing connection attempt was cancelled.  Fail that Deferred with 
an error.ConnectingCancelledError.
| Parameters | deferred | The Deferredthat 
was cancelled; should be the same asself._onConnection. (type:Deferred) | 
| Returns | None | |
| Note | This relies on startedConnecting having been called, so it may seem as 
though there's a race condition where _connectormay not have 
been set.  However, using public APIs, this condition is impossible to 
catch, because a connection API 
(connectTCP/SSL/UNIX) is always 
invoked before a_WrappingFactory'sDeferredis
returned toconnect()'s caller. | |
Stop notifications are passed straight through to the wrapped factory.
Proxy buildProtocol to our 
self._wrappedFactory or errback the 
self._onConnection Deferred if 
the wrapped factory raises an exception or returns None.
| Returns | An instance of _WrappingProtocolorNone | |
Errback the self._onConnection Deferred when 
the client connection fails.