Package apt_p2p :: Module policies :: Class TimeoutFactory
[hide private]
[frames] | no frames]

Class TimeoutFactory

source code


Factory for TimeoutWrapper.

Stability: Unstable

Nested Classes [hide private]
  protocol
Protocol that automatically disconnects when the connection is idle.
Instance Methods [hide private]
 
__init__(self, wrappedFactory, timeoutPeriod=1800) source code
 
buildProtocol(self, addr)
Create an instance of a subclass of Protocol.
source code
 
callLater(self, period, func)
Wrapper around reactor.callLater for test purpose.
source code

Inherited from twisted.internet.protocol.Factory: __providedBy__, startFactory, stopFactory

    Inherited from WrappingFactory
 
clientConnectionFailed(self, connector, reason)
Called when a connection has failed to connect.
source code
 
clientConnectionLost(self, connector, reason)
Called when an established connection is lost.
source code
 
doStart(self)
Make sure startFactory is called.
source code
 
doStop(self)
Make sure stopFactory is called.
source code
 
registerProtocol(self, p)
Called by protocol to register itself.
source code
 
startedConnecting(self, connector)
Called when a connection has been started.
source code
 
unregisterProtocol(self, p)
Called by protocols when they go away.
source code
Class Variables [hide private]

Inherited from twisted.internet.protocol.Factory: __implemented__, __provides__, noisy, numPorts

Method Details [hide private]

__init__(self, wrappedFactory, timeoutPeriod=1800)
(Constructor)

source code 
Overrides: WrappingFactory.__init__

buildProtocol(self, addr)

source code 

Create an instance of a subclass of Protocol.

The returned instance will handle input on an incoming server connection, and an attribute "factory" pointing to the creating factory.

Override this method to alter how Protocol instances get created.

Parameters:
  • addr - an object implementing twisted.internet.interfaces.IAddress
Overrides: twisted.internet.protocol.Factory.buildProtocol
(inherited documentation)