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

Can there be a timeout attribute on the Connect method? #105

Open
fidesachates opened this issue Feb 18, 2024 · 1 comment
Open

Can there be a timeout attribute on the Connect method? #105

fidesachates opened this issue Feb 18, 2024 · 1 comment

Comments

@fidesachates
Copy link

fidesachates commented Feb 18, 2024

Basically the title. I have a python web app and would like to limit my request times by limiting how long the client tries to connect to the tv.

Thank you for your work on this library!

@supersaiyanmode
Copy link
Owner

supersaiyanmode commented Feb 19, 2024

From looking at ws4py's source, it should be fairly straightforward:

[UNTESTED CODE]

client = WebOSClient.discover()[0] # Use discover(secure=True) for newer models.
client.sock.settimeout(5)  # 5 seconds timeout.
client.connect()

Can you please verify if this works? If so, I'll add an option to the connect method to support timeout.

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

2 participants