Skip to content

stop wifi asyncore loop #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ai2010 opened this issue Jul 20, 2019 · 0 comments
Open

stop wifi asyncore loop #126

ai2010 opened this issue Jul 20, 2019 · 0 comments

Comments

@ai2010
Copy link

ai2010 commented Jul 20, 2019

Hi I modified the wifi.py to stop after a certain time , specifically the loop function

def loop(self,timeloop=None):
    if timeloop:
        self.thread = threading.Thread(target=asyncore.loop, kwargs={'timeout': 1})
        self.thread.setDaemon(True)
        self.thread.start()
        time.sleep(timeloop)
        self.local_wifi_server.close()
        self.thread.join(timeout=1)
        return
    else:
        asyncore.loop()

I hope it can be useful to someone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant