code: def stop(self, dummy_signum=None, dummy_frame=None):
          
          logging.info('Shutting down ...')
          self.socket.close()
          sys.exit(0)
docs: Shutdown process (this method is also a signal handler)