def SvcStop(self): self.netkeeper.disconnect() self.logger.info("service is stop....") self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) win32event.SetEvent(self.hWaitStop) self.run = False