def run(self):
        """This is the main serving loop."""
        if self._stats.error:
            self._transmit_error()
            self._close()
            return
        self._parse_options()
        if self._options:
            self._transmit_oack()
        else:
            self._next_block()
            self._transmit_data()
        while not self._should_stop:
            try:
                self.run_once()
            except (__HOLE__, SystemExit):
                logging.info(
                    'Caught KeyboardInterrupt/SystemExit exception. '
                    'Will exit.'
                )
                break
        self._close()
dataset/ETHPy150Open facebook/fbtftp/fbtftp/base_handler.py/BaseHandler.run