Skip to content
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

Stuck when disabling Wi-Fi through Wi-Fi connection #119

Open
Victrid opened this issue Oct 26, 2020 · 1 comment
Open

Stuck when disabling Wi-Fi through Wi-Fi connection #119

Victrid opened this issue Oct 26, 2020 · 1 comment

Comments

@Victrid
Copy link
Contributor

Victrid commented Oct 26, 2020

When disabling Wi-Fi through Wi-Fi connection, the function waits for the response but apparently the connection is closed before the response is made by the device.
I think a timeout can be set in the disable-wifi function to check if the Wi-Fi is turned off.
Sorry for the bad formation, I clicked the wrong button and the sentence was sent before I finished typing.

@Victrid Victrid changed the title Stuckdisabling Wi-Fi through Wi-Fi connection Stuck when disabling Wi-Fi through Wi-Fi connection Oct 26, 2020
@Victrid
Copy link
Contributor Author

Victrid commented Oct 26, 2020

I'm thinking of something like this

def disable_wifi(self):
    # Create and run a thread to do the disabling task #
    time.sleep(5)
    if thread.is_alive():
        # Kill the thread #
    return

but python do not provide such thread killing method. Disabling Wi-Fi uses the urllib which didn't allow me to insert some signal handler for timeout killing.

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