Manages a third-party process which launches a server.

Uses ConchTestForwardingPort to connect to the third-party server. Once ConchTestForwardingPort has disconnected, kill the process and fire a Deferred with the data received by the ConchTestForwardingPort.

Instance Variable deferred Set by whatever uses this object. Accessed using _getDeferred, which destroys the value so the Deferred is not fired twice. Fires when the process is terminated.
Method __init__
Method connectionMade Called when a connection is made.
Method forwardingPortDisconnected The network connection has died; save the buffer of output from the network and attempt to quit the process gracefully, and then (after the reactor has spun) send it a KILL signal.
Method processEnded Fire the Deferred at self.deferred with the data collected from the ConchTestForwardingPort connection, if any.
Method _getDeferred Undocumented
Method _connect No summary
Method _ebConnect Undocumented
Method _reallyDie Undocumented

Inherited from ProcessProtocol:

Method childDataReceived Called when data arrives from the child process.
Method outReceived Some data was received from stdout.
Method errReceived Some data was received from stderr.
Method childConnectionLost Called when a file descriptor associated with the child process is closed.
Method inConnectionLost This will be called when stdin is closed.
Method outConnectionLost This will be called when stdout is closed.
Method errConnectionLost This will be called when stderr is closed.
Method processExited This will be called when the subprocess exits.

Inherited from BaseProtocol (via ProcessProtocol):

Method makeConnection Make a connection to a transport and a server.
deferred =
Set by whatever uses this object. Accessed using _getDeferred, which destroys the value so the Deferred is not fired twice. Fires when the process is terminated.
def __init__(self, port, data):
@type port: L{int}
        @param port: The port on which the third-party server is listening.
        (it is assumed that the server is running on localhost).

        @type data: L{str}
        @param data: This is sent to the third-party server. Must end with '
'
        in order to trigger a disconnect.
        
def _getDeferred(self):
Undocumented
def connectionMade(self):

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

def _connect(self):

Connect to the server, which is often a third-party process. Tries to reconnect if it fails because we have no way of determining exactly when the port becomes available for listening -- we can only know when the process starts.

def _ebConnect(self, f):
Undocumented
def forwardingPortDisconnected(self, buffer):

The network connection has died; save the buffer of output from the network and attempt to quit the process gracefully, and then (after the reactor has spun) send it a KILL signal.

def _reallyDie(self):
Undocumented
def processEnded(self, reason):

Fire the Deferred at self.deferred with the data collected from the ConchTestForwardingPort connection, if any.

API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.