# ``twisted`.`internet`.`protocol`.`ProcessProtocol``

class documentation

`class ProcessProtocol(BaseProtocol): (source)`

Known subclasses: `twisted.conch.ssh.session.SSHSessionProcessProtocol`, `twisted.conch.stdio.TerminalProcessProtocol`, `twisted.mail.alias.ProcessAliasProtocol`, `twisted.runner.procmon.LoggingProtocol`, `twisted.trial._dist.worker.LocalWorker`, `twisted.web.twcgi.CGIProcessProtocol`, `twisted.conch.ssh.session._ProtocolWrapper`, `twisted.internet.endpoints._WrapIProtocol`, `twisted.internet.utils._BackRelay`, `twisted.internet.utils._EverythingGetter`, `twisted.internet.utils._ValueGetter`

Implements interfaces: `twisted.internet.interfaces.IProcessProtocol`

View In Hierarchy

Base process protocol implementation which does simple dispatching for stdin, stdout, and stderr file descriptors.

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

Inherited from `BaseProtocol`:

Method | `connectionMade` | Called when a connection is made.
Method | `makeConnection` | Make a connection to a transport and a server.
Instance Variable | `connected` | Undocumented
Instance Variable | `transport` | Undocumented

def childConnectionLost(self, childFD): (source)
from `twisted.internet.interfaces.IProcessProtocol`
overridden in `twisted.conch.stdio.TerminalProcessProtocol`
Called when a file descriptor associated with the child process is closed.

Parameters
childFD:`int` | The file descriptor which was closed.

def childDataReceived(self, childFD, data): (source)
from `twisted.internet.interfaces.IProcessProtocol`
overridden in `twisted.trial._dist.worker.LocalWorker`, `twisted.internet.endpoints._WrapIProtocol`
Called when data arrives from the child process.

Parameters
childFD:`int` | The file descriptor from which the data was received.
data:`bytes` | The data read from the child's file descriptor.

def errConnectionLost(self): (source)
overridden in `twisted.conch.ssh.session.SSHSessionProcessProtocol`
This will be called when stderr is closed.
def errReceived(self, data): (source)
overridden in `twisted.conch.ssh.session.SSHSessionProcessProtocol`, `twisted.conch.stdio.TerminalProcessProtocol`, `twisted.runner.procmon.LoggingProtocol`, `twisted.trial._dist.worker.LocalWorker`, `twisted.web.twcgi.CGIProcessProtocol`
Some data was received from stderr.

Parameters
data:`bytes` | Undocumented

def inConnectionLost(self): (source)
This will be called when stdin is closed.
def outConnectionLost(self): (source)
overridden in `twisted.conch.ssh.session.SSHSessionProcessProtocol`
This will be called when stdout is closed.
def outReceived(self, data): (source)
overridden in `twisted.conch.ssh.session.SSHSessionProcessProtocol`, `twisted.conch.stdio.TerminalProcessProtocol`, `twisted.runner.procmon.LoggingProtocol`, `twisted.trial._dist.worker.LocalWorker`, `twisted.web.twcgi.CGIProcessProtocol`, `twisted.conch.ssh.session._ProtocolWrapper`, `twisted.internet.utils._BackRelay`
Some data was received from stdout.

Parameters
data:`bytes` | Undocumented

def processEnded(self, reason): (source)
from `twisted.internet.interfaces.IProcessProtocol`
overridden in `twisted.conch.ssh.session.SSHSessionProcessProtocol`, `twisted.conch.stdio.TerminalProcessProtocol`, `twisted.mail.alias.ProcessAliasProtocol`, `twisted.runner.procmon.LoggingProtocol`, `twisted.trial._dist.worker.LocalWorker`, `twisted.web.twcgi.CGIProcessProtocol`, `twisted.conch.ssh.session._ProtocolWrapper`, `twisted.internet.endpoints._WrapIProtocol`, `twisted.internet.utils._BackRelay`, `twisted.internet.utils._EverythingGetter`, `twisted.internet.utils._ValueGetter`
Called when the child process exits and all file descriptors associated with it have been closed.

Parameters
reason:`twisted.python.failure.Failure` | Undocumented

def processExited(self, reason): (source)
from `twisted.internet.interfaces.IProcessProtocol`
This will be called when the subprocess exits.

Parameters
reason:`twisted.python.failure.Failure` | Undocumented