def METHOD_NAME(self) -> None:
    """
    EOF should only be sent when both STDOUT and STDERR have been closed.
    """
    if self.lostOutOrErrFlag:
        self.session.conn.sendEOF(self.session)
    else:
        self.lostOutOrErrFlag = True