Part of twisted.application View Source
Here are services to run clients, servers and periodic services using the reactor.
If you want to run a server service, StreamServerEndpointService
defines a service that can wrap an arbitrary IStreamServerEndpoint
as an IService
.
See also twisted.application.strports.service
for constructing one of these directly from a descriptive string.
Additionally, this module (dynamically) defines various Service subclasses that let you represent clients and servers in a Service hierarchy. Endpoints APIs should be preferred for stream server services, but since those APIs do not yet exist for clients or datagram services, many of these are still useful.
They are as follows:
TCPServer, TCPClient, UNIXServer, UNIXClient, SSLServer, SSLClient, UDPServer, UDPClient, UNIXDatagramServer, UNIXDatagramClient, MulticastServer
These classes take arbitrary arguments in their constructors and pass them straight on to their respective reactor.listenXXX or reactor.connectXXX calls.
For example, the following service starts a web server on port 8080:
TCPServer(8080, server.Site(r))
. See the documentation for
the reactor.listen/connect* methods for more information.
Class | GenericServer | Serve Generic clients |
Class | GenericClient | Connect to Generic. |
Class | TimerService | Service to periodically call a function |
Class | CooperatorService | Simple service.IService
which starts and stops a twisted.internet.task.Cooperator . |
Class | StreamServerEndpointService | A StreamServerEndpointService
is an IService
which runs a server on a listening port described by an IStreamServerEndpoint . |
Function | _maybeGlobalReactor | |
Class | _VolatileDataService | Undocumented |
Class | _AbstractServer | |
Class | _AbstractClient |
Returns | the argument, or the global reactor if the argument is None . |