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.
        """
        self.buffer = buffer
        self.transport.write(b'\x03')
        self.transport.loseConnection()
        reactor.callLater(0, self._reallyDie)

        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.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_conch.py