Package twisted :: Package protocols :: Module ftp :: Class FTPFactory
[frames | no frames]

Class FTPFactory

Factory --+
          |
         FTPFactory


A factory for producing ftp protocol instances
Method Summary
  __init__(self, portal, userAnonymous, maxProtocolInstances)
  buildProtocol(self, addr)
Create an instance of a subclass of Protocol.
  stopFactory(self)
This will be called before I stop listening on all Ports/Connectors.
    Inherited from Factory
  doStart(self)
Make sure startFactory is called.
  doStop(self)
Make sure stopFactory is called.
  startFactory(self)
This will be called before I begin listening on a Port or Connector.

Instance Variable Summary
NoneType maxProtocolInstances: the maximum number of FTP protocol instances this factory will create.
int timeOut: the protocol interpreter's idle timeout time in seconds, default is 600 seconds

Class Variable Summary
int allowAnonymous = 1                                                                     
int currentInstanceNum = 0                                                                     
list instances = []
type protocol = twisted.protocols.ftp.FTP
str userAnonymous = 'anonymous'
    Inherited from Factory
tuple __implements__ = (<class twisted.internet.interfaces.IPr...
str noisy = 'sure, why not'
int numPorts = 0                                                                     

Method Details

buildProtocol(self, addr)

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)

stopFactory(self)

This will be called before I stop listening on all Ports/Connectors.

This can be used 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.
Overrides:
twisted.internet.protocol.Factory.stopFactory (inherited documentation)

Instance Variable Details

maxProtocolInstances

the maximum number of FTP protocol instances this factory will create. When the maximum number is reached, a protocol instance will be spawned that will give the "Too many connections" message to the client and then close the connection.
Type:
NoneType
Value:
None                                                                  

timeOut

the protocol interpreter's idle timeout time in seconds, default is 600 seconds
Type:
int
Value:
600                                                                   

Class Variable Details

allowAnonymous

Type:
int
Value:
1                                                                     

currentInstanceNum

Type:
int
Value:
0                                                                     

instances

Type:
list
Value:
[]                                                                     

userAnonymous

Type:
str
Value:
'anonymous'                                                            

Generated by Epydoc 2.0 on Sat May 15 20:08:17 2004 http://epydoc.sf.net