Skip to content

stop wifi asyncore loop #126

Description

@ai2010

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions