Table of Contents

Class: Application | Twisted-0.19.0/twisted/internet/app.py
--- | ---
### I am the `root object' in a Twisted process. I represent a set of persistent, potentially interconnected listening TCP ports, delayed event schedulers, and service.Services.
Base Classes |
--- | ---
log.Logger styles.Versioned marmalade.DOMJellyable
Methods |
--- | ---
__getstate__ __init__ __repr__ _afterShutDown _beforeShutDown _cbConnectTCP _cbListenTCP _getChildElements addConnector addDelayed addService bindPorts connectSSL | connectTCP dontListenUDP getServiceNamed jellyToDOM_1 listenSSL listenTCP listenUDP logPrefix removeDelayed run save setUID unjellyFromDOM_1 | unlistenTCP upgradeToVersion1 upgradeToVersion2 upgradeToVersion3 upgradeToVersion4 upgradeToVersion5 upgradeToVersion6 upgradeToVersion7 upgradeToVersion8
| __getstate__
    __getstate__ ( self )
| __init__
    __init__ (
            self,
            name,
            uid=None,
            gid=None,
            authorizer=None,
            authorizer_=None,
            )
### Initialize me. #### Arguments: name: a name uid: (optional) a POSIX user-id. Only used on POSIX systems. gid: (optional) a POSIX group-id. Only used on POSIX systems. authorizer: a twisted.cred.authorizer.Authorizer. If uid and gid arguments are not provided, this application will default to having the uid and gid of the user and group who created it.
| __repr__
    __repr__ ( self )
| _afterShutDown
    _afterShutDown ( self )
| _beforeShutDown
    _beforeShutDown ( self )
| _cbConnectTCP
    _cbConnectTCP (
            self,
            factory,
            hostname,
            portno,
            timeout,
            )
| _cbListenTCP
    _cbListenTCP (
            self,
            factory,
            portno,
            backlog,
            interface,
            )
| _getChildElements
    _getChildElements ( self,  node )
| addConnector
    addConnector ( self,  connector )
Add a connector to this Application.
| addDelayed
    addDelayed ( self,  delayed )
### Adds an object implementing delay.IDelayed for execution in my event loop. The timeout for select() will be calculated based on the sum of all Delayed instances attached to me, using their `timeout` method. In this manner, delayed instances should have their various callbacks called approximately when they're supposed to be (based on when they were registered). This is not hard realtime by any means; depending on server load, the callbacks may be called in more or less time. However, `simulation time` for each Delayed instance will be monotonically increased on a regular basis. See the documentation for twisted.python.delay.Delayed and IDelayed for details.
| addService
    addService ( self,  service )
Add a service to this application.
| bindPorts
    bindPorts ( self )
| connectSSL
    connectSSL (
            self,
            host,
            port,
            factory,
            ctxFactory=None,
            )
Connect a given client protocol factory to a specific SSL server.
| connectTCP
    connectTCP (
            self,
            host,
            port,
            factory,
            timeout=30,
            )
### Connect a given client protocol factory to a specific TCP server. If the client gets disconnected, a new instance will be created and will attempt to reconnect. If you only want a single connection, use twisted.internet.reactor's clientTCP() method instead.
| dontListenUDP
    dontListenUDP ( self,  portno )
Exceptions |
--- | ---
'temporarily not implemented'
| getServiceNamed
    getServiceNamed ( self,  serviceName )
### Retrieve the named service from this application. Raise a KeyError if there is no such service name.
| jellyToDOM_1
    jellyToDOM_1 (
            self,
            jellier,
            node,
            )
| listenSSL
    listenSSL (
            self,
            port,
            factory,
            ctxFactory,
            backlog=5,
            interface='',
            )
Connects a given protocol factory to the given numeric TCP/IP port. The connection is a SSL one, using contexts created by the context factory.
| listenTCP
    listenTCP (
            self,
            port,
            factory,
            backlog=5,
            interface='',
            )
Connects a given protocol factory to the given numeric TCP/IP port.
| listenUDP
    listenUDP (
            self,
            port,
            factory,
            interface='',
            maxPacketSize=8192,
            )
Connects a given protocol factory to the given numeric UDP port.
| logPrefix
    logPrefix ( self )
A log prefix which describes me.
| removeDelayed
    removeDelayed ( self,  delayed )
Remove a Delayed previously added to the main event loop with addDelayed.
| run
    run (
            self,
            save=1,
            installSignalHandlers=1,
            )
run(save=1, installSignalHandlers=1) Run this application, running the main loop if necessary. If `save` is true, then when this Application is shut down, it will be persisted to a pickle. `installSignalHandlers` is passed through to main.run(), the function that starts the mainloop.
| save
    save (
            self,
            tag=None,
            filename=None,
            )
Save a pickle of this application to a file in the current directory.
| setUID
    setUID ( self )
Retrieve persistent uid/gid pair (if possible) and set the current process's uid/gid
| unjellyFromDOM_1
    unjellyFromDOM_1 (
            self,
            unjellier,
            node,
            )
Exceptions |
--- | ---
ValueError( "Couldn't determine type of TCP node." )
| unlistenTCP
    unlistenTCP (
            self,
            port,
            interface='',
            )
| upgradeToVersion1
    upgradeToVersion1 ( self )
Version 1 Persistence Upgrade
| upgradeToVersion2
    upgradeToVersion2 ( self )
Version 2 Persistence Upgrade
| upgradeToVersion3
    upgradeToVersion3 ( self )
Version 3 Persistence Upgrade
| upgradeToVersion4
    upgradeToVersion4 ( self )
Version 4 Persistence Upgrade
| upgradeToVersion5
    upgradeToVersion5 ( self )
| upgradeToVersion6
    upgradeToVersion6 ( self )
| upgradeToVersion7
    upgradeToVersion7 ( self )
| upgradeToVersion8
    upgradeToVersion8 ( self )

Table of Contents

This document was automatically generated on Sun Jul 14 19:52:41 2002 by HappyDoc version 2.0