I represent a set of persistent, potentially interconnected listening TCP
ports, delayed event schedulers, and service.Services.
Methods
|
|
|
|
__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 )
|
|
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.
|
|
addPort
|
addPort ( self, port )
Adds a listening port (an instance of a twisted.internet.tcp.Port) to
this Application, to be bound when it's running.
|
|
addService
|
addService ( self, service )
Add a service to this application.
|
|
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,
)
Connect a given client protocol factory to a specific TCP server.
|
|
dontListenTCP
|
dontListenTCP ( self, portno )
|
|
dontListenUDP
|
dontListenUDP ( self, portno )
|
|
getServiceNamed
|
getServiceNamed ( self, serviceName )
Retrieve the named service from this application.
Raise a KeyError if there is no such service name.
|
|
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
|
|
shutDownSave
|
shutDownSave ( self )
Persist a pickle, then stop all protocol factories.
The pickle will be named "%(self.name)s-shutdown.tap". First, all
currently active factories will have thier stopFactory method called.
|
|
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 )
|