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

get response timeout #28

Closed
samsomlw opened this issue Nov 5, 2022 · 3 comments
Closed

get response timeout #28

samsomlw opened this issue Nov 5, 2022 · 3 comments

Comments

@samsomlw
Copy link

samsomlw commented Nov 5, 2022

use this to add a timeout to while get response
timeout = time.time() + int(defualtConnectionTimeout)
while rescode[:1] == '1' and time.time() < timeout:

@Pepelux
Copy link
Owner

Pepelux commented Nov 5, 2022

what script are you talking about?

@samsomlw
Copy link
Author

samsomlw commented Nov 5, 2022

like script invite when u get response if no connection to ip u will get infinty loop in while
because you will always get the error 100 timeout

@Pepelux
Copy link
Owner

Pepelux commented Nov 5, 2022

It doesn't work because the socket also waits for its timeout. I've solved it adding a try-except timeout and in case of socket timeout do an exit.

Thanks for the advise.

@Pepelux Pepelux closed this as completed Nov 5, 2022
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