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

Class LimitConnectionsByPeer

source code


Stability: Unstable

Nested Classes [hide private]
    Inherited from WrappingFactory
  protocol
Wraps protocol instances and acts as their transport as well.
Instance Methods [hide private]
 
startFactory(self)
This will be called before I begin listening on a Port or Connector.
source code
 
buildProtocol(self, addr)
Create an instance of a subclass of Protocol.
source code
 
unregisterProtocol(self, p)
Called by protocols when they go away.
source code

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

    Inherited from WrappingFactory
 
__init__(self, wrappedFactory) source code
 
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
Class Variables [hide private]
  maxConnectionsPerPeer = 5

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

Method Details [hide private]

startFactory(self)

source code 

This will be called before I begin listening on a Port or Connector.

It will only be called once, even if the factory is connected to multiple ports.

This can be used to perform 'unserialization' tasks that are best put off until things are actually running, such as connecting to a database, opening files, etcetera.

Overrides: twisted.internet.protocol.Factory.startFactory
(inherited documentation)

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)

unregisterProtocol(self, p)

source code 

Called by protocols when they go away.

Overrides: WrappingFactory.unregisterProtocol
(inherited documentation)