Skip to content

how to set timeout on recv()? #141

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

Closed
JoyCood opened this issue Nov 2, 2016 · 1 comment
Closed

how to set timeout on recv()? #141

JoyCood opened this issue Nov 2, 2016 · 1 comment

Comments

@JoyCood
Copy link

JoyCood commented Nov 2, 2016

is it support set timeout on recv()? when the recv() method does not get any message within timeout, we consider the connection is lose and throw it away.

@aaugustin
Copy link
Member

There's nothing special in websockets, the usual asyncio API does the job:

yield from asyncio.wait_for(ws.recv(), timeout=10)

@aaugustin aaugustin mentioned this issue Jun 23, 2019
18 tasks
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