Module Expr Str ImportFrom alias alias ImportFrom alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias alias alias FunctionDef arguments args NameParam defaults body Expr Str If CompareIs NameLoad NameLoad body ImportFrom alias Return NameLoad orelse Return NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body Assign NameStore ListLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore AttributeLoad NameLoad attr body If CompareIn NameLoad NameLoad body Delete SubscriptDel NameLoad Index NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults vararg kwarg body Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Delete AttributeDel NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call Call NameLoad Call NameLoad AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults vararg kwarg body Assign AttributeStore NameLoad attr NameLoad If CompareIn Str NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Delete AttributeDel NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call Call NameLoad Call NameLoad AttributeLoad NameLoad attr BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list Assign NameStore Dict Str Str Str Str For NameStore Call AttributeLoad Str attr body For NameStore Call AttributeLoad Str attr body If BoolOpAnd CompareEq NameLoad Str CompareEq NameLoad Str body Continue If BoolOpAnd CompareEq NameLoad Str CompareEq NameLoad Str body Continue Assign NameStore SubscriptLoad Call NameLoad Index BinOpAdd Str NameLoad Assign NameStore BinOpMod SubscriptLoad NameLoad Index NameLoad Call NameLoad Assign NameStore Call NameLoad BinOpAdd NameLoad NameLoad TupleLoad NameLoad Dict Str Str NameLoad NameLoad Assign SubscriptStore Call NameLoad Index BinOpAdd NameLoad NameLoad NameLoad ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str Str FunctionDef arguments args NameParam NameParam NameParam defaults vararg kwarg body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr TupleLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Lambda arguments args NameParam defaults Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr NameLoad body Expr Str Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore ListLoad FunctionDef arguments args NameParam defaults body If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad orelse If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam defaults body If CompareIsNot NameLoad NameLoad body Return Call AttributeLoad NameLoad attr decorator_list Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryFinally body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad finalbody Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num Num NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Return BinOpAdd Call NameLoad BinOpMult NameLoad BinOpPow NameLoad NameLoad NameLoad Call NameLoad decorator_list Return NameLoad decorator_list Assign NameStore Call NameLoad FunctionDef arguments args defaults body Expr Str decorator_list ClassDef bases AttributeLoad NameLoad attr NameLoad body Expr Str Assign NameStore Call NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore IfExp CompareIs NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call NameLoad AttributeLoad NameLoad attr orelse If AttributeLoad NameLoad attr body Return Call NameLoad Call NameLoad orelse Assign NameStore Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore AttributeStore NameLoad attr NameStore TupleLoad ListLoad AttributeLoad NameLoad attr For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Return Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Num FunctionDef arguments args defaults body Assign NameStore Call NameLoad FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad decorator_list Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Return AugAssignAdd AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad attr decorator_list Expr Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body If UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad Return NameLoad decorator_list Return Call AttributeLoad Call NameLoad ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list Assign NameStore BinOpAdd ListLoad Str Str Str Str Str Str ListComp BinOpAdd NameLoad NameLoad comprehension NameStore Call AttributeLoad Str attr comprehension NameStore Call AttributeLoad Str attr
N/A N/A 
Reactor-based Services

Here are services to run clients, servers and periodic services using
the reactor.

If you want to run a server service, L{StreamServerEndpointService} defines a
service that can wrap an arbitrary L{IStreamServerEndpoint
<twisted.internet.interfaces.IStreamServerEndpoint>}
as an L{IService}. See also L{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,
  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:
C{TCPServer(8080, server.Site(r))}.  See the documentation for the
reactor.listen/connect* methods for more information.
 __future__ absolute_import division random random _goodEnoughRandom twisted.python log twisted.logger Logger twisted.application service twisted.internet task twisted.python.failure Failure twisted.internet.defer CancelledError gatherResults Deferred succeed fail _maybeGlobalReactor N/A N/A maybeReactor N/A N/A N/A 
    @return: the argument, or the global reactor if the argument is C{None}.
     N/A N/A maybeReactor None N/A twisted.internet reactor N/A reactor N/A N/A maybeReactor N/A _VolatileDataService N/A N/A service Service N/A N/A volatile N/A __getstate__ N/A N/A self N/A N/A N/A d N/A N/A N/A service Service __getstate__ self N/A attr N/A self volatile N/A N/A N/A attr d N/A N/A N/A d N/A attr N/A d N/A N/A _AbstractServer N/A _VolatileDataService N/A N/A 
    @cvar volatile: list of attribute to remove from pickling.
    @type volatile: C{list}

    @ivar method: the type of method to call on the reactor, one of B{TCP},
        B{UDP}, B{SSL} or B{UNIX}.
    @type method: C{str}

    @ivar reactor: the current running reactor.
    @type reactor: a provider of C{IReactorTCP}, C{IReactorUDP},
        C{IReactorSSL} or C{IReactorUnix}.

    @ivar _port: instance of port set when the service is started.
    @type _port: a provider of L{twisted.internet.interfaces.IListeningPort}.
     N/A volatile N/A _port N/A method None N/A reactor None N/A _port None __init__ N/A N/A self N/A args kwargs N/A N/A N/A self args args N/A N/A reactor kwargs N/A N/A N/A self reactor N/A N/A kwargs pop reactor N/A N/A self kwargs kwargs N/A privilegedStartService N/A N/A self N/A N/A N/A N/A N/A N/A service Service privilegedStartService self N/A N/A self _port N/A N/A self _getPort N/A startService N/A N/A self N/A N/A N/A N/A N/A N/A service Service startService self N/A N/A N/A self _port None N/A N/A N/A self _port N/A N/A self _getPort N/A stopService N/A N/A self N/A N/A N/A N/A N/A N/A service Service stopService self N/A N/A N/A self _port None N/A N/A d N/A N/A N/A self _port stopListening N/A N/A self _port N/A d N/A _getPort N/A N/A self N/A N/A N/A 
        Wrapper around the appropriate listen method of the reactor.

        @return: the port object returned by the listen method.
        @rtype: an object providing
            L{twisted.internet.interfaces.IListeningPort}.
         N/A N/A N/A getattr N/A _maybeGlobalReactor N/A self reactor N/A listen%s N/A N/A self method N/A self args N/A self kwargs N/A N/A _AbstractClient N/A _VolatileDataService N/A N/A 
    @cvar volatile: list of attribute to remove from pickling.
    @type volatile: C{list}

    @ivar method: the type of method to call on the reactor, one of B{TCP},
        B{UDP}, B{SSL} or B{UNIX}.
    @type method: C{str}

    @ivar reactor: the current running reactor.
    @type reactor: a provider of C{IReactorTCP}, C{IReactorUDP},
        C{IReactorSSL} or C{IReactorUnix}.

    @ivar _connection: instance of connection set when the service is started.
    @type _connection: a provider of L{twisted.internet.interfaces.IConnector}.
     N/A volatile N/A _connection N/A method None N/A reactor None N/A _connection None __init__ N/A N/A self N/A args kwargs N/A N/A N/A self args args N/A N/A reactor kwargs N/A N/A N/A self reactor N/A N/A kwargs pop reactor N/A N/A self kwargs kwargs N/A startService N/A N/A self N/A N/A N/A N/A N/A N/A service Service startService self N/A N/A self _connection N/A N/A self _getConnection N/A stopService N/A N/A self N/A N/A N/A N/A N/A N/A service Service stopService self N/A N/A N/A self _connection None N/A N/A N/A N/A N/A self _connection disconnect N/A N/A self _connection N/A _getConnection N/A N/A self N/A N/A N/A 
        Wrapper around the appropriate connect method of the reactor.

        @return: the port object returned by the connect method.
        @rtype: an object providing L{twisted.internet.interfaces.IConnector}.
         N/A N/A N/A getattr N/A _maybeGlobalReactor N/A self reactor N/A connect%s N/A N/A self method N/A self args N/A self kwargs N/A N/A N/A _doc N/A Client Server Connect to %(tran)s

Call reactor.connect%(tran)s when the service starts, with the
arguments given to the constructor.
 Serve %(tran)s clients

Call reactor.listen%(tran)s when the service starts, with the
arguments given to the constructor. When the service stops,
stop listening. See twisted.internet.interfaces for documentation
on arguments to the reactor method.
 N/A tran N/A N/A TCP UNIX SSL UDP UNIXDatagram Multicast split N/A N/A side N/A N/A Server Client split N/A N/A N/A N/A tran Multicast N/A side Client N/A N/A N/A N/A N/A tran UDP N/A side Client N/A N/A N/A base N/A N/A globals N/A N/A _Abstract side N/A doc N/A N/A _doc N/A side N/A vars N/A klass N/A type N/A tran side N/A base N/A method __doc__ tran doc N/A N/A N/A globals N/A N/A tran side klass TimerService N/A _VolatileDataService N/A N/A 
    Service to periodically call a function

    Every C{step} seconds call the given function with the given arguments.
    The service starts the calls when it starts, and cancels them
    when it stops.

    @ivar clock: Source of time. This defaults to L{None} which is
        causes L{twisted.internet.reactor} to be used.
        Feel free to set this to something else, but it probably ought to be
        set *before* calling L{startService}.
    @type clock: L{IReactorTime<twisted.internet.interfaces.IReactorTime>}

    @ivar call: Function and arguments to call periodically.
    @type call: L{tuple} of C{(callable, args, kwargs)}
     N/A volatile N/A _loop _loopFinished __init__ N/A N/A self step callable N/A args kwargs N/A N/A 
        @param step: The number of seconds between calls.
        @type step: L{float}

        @param callable: Function to call
        @type callable: L{callable}

        @param args: Positional arguments to pass to function
        @param kwargs: Keyword arguments to pass to function
         N/A N/A self step step N/A N/A self call N/A callable args kwargs N/A N/A self clock None N/A startService N/A N/A self N/A N/A N/A N/A N/A N/A service Service startService self N/A N/A callable args kwargs N/A self call N/A N/A self _loop N/A N/A task LoopingCall callable args kwargs N/A N/A N/A self _loop clock N/A _maybeGlobalReactor N/A self clock N/A N/A self _loopFinished N/A N/A N/A self _loop start N/A self step now True N/A N/A N/A N/A self _loopFinished addErrback N/A self _failed N/A _failed N/A N/A self why N/A N/A N/A N/A N/A self _loop running False N/A N/A N/A log err why N/A stopService N/A N/A self N/A N/A N/A 
        Stop the service.

        @rtype: L{Deferred<defer.Deferred>}
        @return: a L{Deferred<defer.Deferred>} which is fired when the
            currently running call (if any) is finished.
         N/A N/A N/A self _loop running N/A N/A N/A N/A N/A self _loop stop N/A N/A N/A N/A self _loopFinished addCallback N/A N/A N/A _ N/A N/A N/A N/A service Service stopService self N/A N/A self _loopFinished N/A N/A CooperatorService N/A N/A service Service N/A N/A 
    Simple L{service.IService} which starts and stops a L{twisted.internet.task.Cooperator}.
     __init__ N/A N/A self N/A N/A N/A N/A self coop N/A N/A task Cooperator started False N/A coiterate N/A N/A self iterator N/A N/A N/A N/A N/A N/A self coop coiterate iterator N/A startService N/A N/A self N/A N/A N/A N/A N/A N/A self coop start N/A stopService N/A N/A self N/A N/A N/A N/A N/A N/A self coop stop N/A N/A StreamServerEndpointService N/A N/A service Service object N/A N/A 
    A L{StreamServerEndpointService} is an L{IService} which runs a server on a
    listening port described by an L{IStreamServerEndpoint
    <twisted.internet.interfaces.IStreamServerEndpoint>}.

    @ivar factory: A server factory which will be used to listen on the
        endpoint.

    @ivar endpoint: An L{IStreamServerEndpoint
        <twisted.internet.interfaces.IStreamServerEndpoint>} provider
        which will be used to listen when the service starts.

    @ivar _waitingForPort: a Deferred, if C{listen} has yet been invoked on the
        endpoint, otherwise None.

    @ivar _raiseSynchronously: Defines error-handling behavior for the case
        where C{listen(...)} raises an exception before C{startService} or
        C{privilegedStartService} have completed.

    @type _raiseSynchronously: C{bool}

    @since: 10.2
     N/A _raiseSynchronously None __init__ N/A N/A self endpoint factory N/A N/A N/A N/A self endpoint endpoint N/A N/A self factory factory N/A N/A self _waitingForPort None N/A privilegedStartService N/A N/A self N/A N/A N/A 
        Start listening on the endpoint.
         N/A N/A N/A N/A service Service privilegedStartService self N/A N/A self _waitingForPort N/A N/A N/A self endpoint listen N/A self factory N/A raisedNow N/A handleIt N/A N/A err N/A N/A N/A N/A self _raiseSynchronously N/A N/A N/A N/A raisedNow append err N/A N/A N/A N/A N/A err check CancelledError N/A N/A N/A N/A log err err N/A N/A N/A N/A N/A self _waitingForPort addErrback handleIt N/A raisedNow N/A N/A N/A N/A N/A raisedNow N/A 0 raiseException N/A startService N/A N/A self N/A N/A N/A 
        Start listening on the endpoint, unless L{privilegedStartService} got
        around to it already.
         N/A N/A N/A N/A service Service startService self N/A N/A N/A self _waitingForPort None N/A N/A N/A N/A self privilegedStartService N/A stopService N/A N/A self N/A N/A N/A 
        Stop listening on the port if it is already listening, otherwise,
        cancel the attempt to listen.

        @return: a L{Deferred<twisted.internet.defer.Deferred>} which fires
            with C{None} when the port has stopped listening.
         N/A N/A N/A N/A self _waitingForPort cancel stopIt N/A N/A port N/A N/A N/A N/A port None N/A N/A N/A N/A port stopListening N/A N/A d N/A N/A N/A self _waitingForPort addCallback stopIt stop N/A N/A passthrough N/A N/A N/A N/A self running False N/A passthrough N/A N/A N/A N/A d addBoth stop N/A d N/A N/A _ReconnectingProtocolProxy N/A object N/A N/A 
    A proxy for a Protocol to provide connectionLost notification to a client
    connection service, in support of reconnecting when connections are lost.
     __init__ N/A N/A self protocol lostNotification N/A N/A N/A 
        Create a L{_ReconnectingProtocolProxy}.

        @param protocol: the application-provided L{interfaces.IProtocol}
            provider.
        @type protocol: provider of L{interfaces.IProtocol} which may
            additionally provide L{interfaces.IHalfCloseableProtocol} and
            L{interfaces.IFileDescriptorReceiver}.

        @param lostNotification: a 1-argument callable to invoke with the
            C{reason} when the connection is lost.
         N/A N/A self _protocol protocol N/A N/A self _lostNotification lostNotification N/A connectionLost N/A N/A self reason N/A N/A N/A 
        The connection was lost.  Relay this information.

        @param reason: The reason the connection was lost.

        @return: the underlying protocol's result
         N/A N/A N/A N/A N/A N/A self _protocol connectionLost reason N/A N/A N/A N/A self _lostNotification reason N/A __getattr__ N/A N/A self item N/A N/A N/A N/A getattr N/A self _protocol item N/A __repr__ N/A N/A self N/A N/A N/A N/A <%s wrapping %r> N/A N/A N/A self __class__ __name__ N/A self _protocol N/A N/A _DisconnectFactory N/A object N/A N/A 
    A L{_DisconnectFactory} is a proxy for L{IProtocolFactory} that catches
    C{connectionLost} notifications and relays them.
     __init__ N/A N/A self protocolFactory protocolDisconnected N/A N/A N/A N/A self _protocolFactory protocolFactory N/A N/A self _protocolDisconnected protocolDisconnected N/A buildProtocol N/A N/A self addr N/A N/A N/A 
        Create a L{_ReconnectingProtocolProxy} with the disconnect-notification
        callback we were called with.

        @param addr: The address the connection is coming from.

        @return: a L{_ReconnectingProtocolProxy} for a protocol produced by
            C{self._protocolFactory}
         N/A N/A _ReconnectingProtocolProxy N/A N/A N/A self _protocolFactory buildProtocol addr N/A self _protocolDisconnected N/A __getattr__ N/A N/A self item N/A N/A N/A N/A getattr N/A self _protocolFactory item N/A __repr__ N/A N/A self N/A N/A N/A N/A <%s wrapping %r> N/A N/A N/A self __class__ __name__ N/A self _protocolFactory N/A N/A backoffPolicy N/A N/A initialDelay maxDelay factor jitter N/A 1.0 60.0 1.5 _goodEnoughRandom N/A N/A 
    A timeout policy for L{ClientService} which computes an exponential backoff
    interval with configurable parameters.

    @since: 16.1.0

    @param initialDelay: Delay for the first reconnection attempt (default
        1.0s).
    @type initialDelay: L{float}

    @param maxDelay: Maximum number of seconds between connection attempts
        (default 60 seconds, or one minute).  Note that this value is before
        jitter is applied, so the actual maximum possible delay is this value
        plus the maximum possible result of C{jitter()}.
    @type maxDelay: L{float}

    @param factor: A multiplicative factor by which the delay grows on each
        failed reattempt.  Default: 1.5.
    @type factor: L{float}

    @param jitter: A 0-argument callable that introduces noise into the delay.
        By default, C{random.random}, i.e. a pseudorandom floating-point value
        between zero and one.
    @type jitter: 0-argument callable returning L{float}

    @return: a 1-argument callable that, given an attempt count, returns a
        floating point number; the number of seconds to delay.
    @rtype: see L{ClientService.__init__}'s C{retryPolicy} argument.
     policy N/A N/A attempt N/A N/A N/A N/A N/A min N/A initialDelay N/A factor attempt maxDelay N/A jitter N/A N/A policy N/A N/A _defaultPolicy N/A backoffPolicy _noop N/A N/A N/A N/A N/A 
    Do nothing; this stands in for C{transport.loseConnection()} and
    C{DelayedCall.cancel()} when L{ClientService} is in a state where there's
    nothing to do.
     N/A ClientService N/A N/A service Service object N/A N/A 
    A L{ClientService} maintains a single outgoing connection to a client
    endpoint, reconnecting after a configurable timeout when a connection
    fails, either before or after connecting.

    @since: 16.1.0
     N/A _log N/A Logger __init__ N/A N/A self endpoint factory retryPolicy clock N/A None None N/A N/A 
        @param endpoint: A L{stream client endpoint
            <interfaces.IStreamClientEndpoint>} provider which will be used to
            connect when the service starts.

        @param factory: A L{protocol factory <interfaces.IProtocolFactory>}
            which will be used to create clients for the endpoint.

        @param retryPolicy: A policy configuring how long L{ClientService} will
            wait between attempts to connect to C{endpoint}.
        @type retryPolicy: callable taking (the number of failed connection
            attempts made in a row (L{int})) and returning the number of
            seconds to wait before making another attempt.

        @param clock: The clock used to schedule reconnection.  It's mainly
            useful to be parametrized in tests.  If the factory is serialized,
            this attribute will not be serialized, and the default value (the
            reactor) will be restored when deserialized.
        @type clock: L{IReactorTime}
         N/A clock N/A _maybeGlobalReactor clock N/A retryPolicy N/A N/A retryPolicy None _defaultPolicy retryPolicy N/A N/A self _endpoint endpoint N/A N/A self _failedAttempts 0 N/A N/A self _stopped False N/A N/A self _factory factory N/A N/A self _timeoutForAttempt retryPolicy N/A N/A self _clock clock N/A N/A self _stopRetry _noop N/A N/A self _lostDeferred N/A succeed None N/A N/A self _connectionInProgress N/A succeed None N/A N/A self _loseConnection _noop N/A N/A self _currentConnection None N/A N/A self _awaitingConnected N/A N/A whenConnected N/A N/A self N/A N/A N/A 
        Retrieve the currently-connected L{Protocol}, or the next one to
        connect.

        @return: a Deferred that fires with a protocol produced by the factory
            passed to C{__init__}
        @rtype: L{Deferred} firing with L{IProtocol} or failing with
            L{CancelledError} the service is stopped.
         N/A N/A N/A self _currentConnection None N/A N/A N/A succeed N/A self _currentConnection N/A N/A N/A self _stopped N/A N/A N/A fail N/A CancelledError N/A N/A result N/A Deferred N/A N/A N/A N/A self _awaitingConnected append result N/A result N/A _unawait N/A N/A self value N/A N/A N/A 
        Fire all outstanding L{ClientService.whenConnected} L{Deferred}s.

        @param value: the value to fire the L{Deferred}s with.
         N/A N/A N/A self _awaitingConnected waiting N/A N/A N/A self _awaitingConnected N/A w waiting N/A N/A N/A N/A w callback value N/A startService N/A N/A self N/A N/A N/A 
        Start this L{ClientService}, initiating the connection retry loop.
         N/A N/A self running N/A N/A N/A N/A N/A self _log warn Duplicate ClientService.startService {log_source} N/A N/A N/A N/A N/A super ClientService self startService N/A N/A self _failedAttempts 0 connectNow N/A N/A N/A N/A N/A thisLostDeferred N/A Deferred clientConnect N/A N/A protocol N/A N/A N/A N/A self _failedAttempts 0 N/A N/A self _loseConnection N/A N/A protocol transport loseConnection N/A N/A self _lostDeferred thisLostDeferred N/A N/A self _currentConnection N/A protocol _protocol N/A N/A N/A self _unawait N/A self _currentConnection N/A clientDisconnect N/A N/A reason N/A N/A N/A N/A self _currentConnection None N/A N/A self _loseConnection _noop N/A N/A N/A thisLostDeferred callback None N/A N/A retry reason N/A N/A factoryProxy N/A _DisconnectFactory N/A self _factory clientDisconnect N/A N/A self _stopRetry _noop N/A N/A self _connectionInProgress N/A N/A N/A N/A N/A N/A N/A self _endpoint connect factoryProxy addCallback clientConnect addErrback retry N/A retry N/A N/A failure N/A N/A N/A N/A N/A self running N/A N/A N/A N/A self _failedAttempts 1 N/A delay N/A N/A self _timeoutForAttempt N/A self _failedAttempts N/A N/A N/A N/A self _log info Scheduling retry {attempt} to connect {endpoint} in {delay} seconds. attempt N/A self _failedAttempts endpoint N/A self _endpoint delay delay N/A N/A self _stopRetry N/A N/A N/A N/A self _clock callLater delay connectNow cancel N/A N/A N/A connectNow N/A stopService N/A N/A self N/A N/A N/A 
        Stop attempting to reconnect and close any existing connections.

        @return: a L{Deferred} that fires when all outstanding connections are
            closed and all in-progress connection attempts halted.
         N/A N/A N/A N/A super ClientService self stopService N/A N/A N/A self _stopRetry N/A N/A self _stopRetry _noop N/A N/A N/A N/A self _connectionInProgress cancel N/A N/A N/A self _loseConnection N/A N/A self _currentConnection None finishStopping N/A N/A result N/A N/A N/A N/A N/A self running N/A N/A N/A self _stopped True N/A N/A N/A self _unawait N/A Failure N/A CancelledError N/A None N/A N/A N/A N/A N/A gatherResults N/A N/A self _connectionInProgress N/A self _lostDeferred addBoth finishStopping N/A N/A N/A __all__ N/A N/A TimerService CooperatorService MulticastServer StreamServerEndpointService UDPServer ClientService N/A N/A tran side N/A tran N/A N/A TCP UNIX SSL UNIXDatagram split N/A side N/A N/A Server Client split