in fbtftp/base_handler.py [0:0]
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 (KeyboardInterrupt, SystemExit):
logging.info(
"Caught KeyboardInterrupt/SystemExit exception. " "Will exit."
)
break
self._close()