'Stop the server
NOTE: The context manager is the recommended way to use
ForwardServer. start()/stop() are alternatives to the context manager
use case and are mutually exclusive with it.'

def stop(self):

    self._logger.info('ForwardServer    STOPPING')
    try:
        self._subproc.terminate()
        self._subproc.join(timeout=self._SUBPROC_TIMEOUT)
        if self._subproc.is_alive():
            self._logger.error('ForwardServer    failed    to    terminate,    killing    it')
            os.kill(self._subproc.pid)
            self._subproc.join(timeout=self._SUBPROC_TIMEOUT)
            assert (not self._subproc.is_alive()), self._subproc
        exit_code = self._subproc.exitcode
        self._logger.info('ForwardServer    terminated    with    exitcode=%s', exit_code)
    finally:
        self._subproc = None
