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

Read and Write timeouts? #156

Open
aathan opened this issue Nov 21, 2022 · 5 comments
Open

Read and Write timeouts? #156

aathan opened this issue Nov 21, 2022 · 5 comments
Labels

Comments

@aathan
Copy link

aathan commented Nov 21, 2022

The follow is not clear from the documentation and not immediately apparent in the code:

Does this ws library respect the HttpServer WriteTimeout & other timeouts set on the writer that is upgraded to a gobwas/ws ?

If not, can this be added as a feature? Implementing timeouts externally is possible but wordy.

E.g. Specifically if WriteServerMessage() is called, will it block forever if the underlying transport is blocked?

@barnesew
Copy link

barnesew commented May 9, 2023

I have also been having issues with wsutil functions blocking forever. I have yet to determine the cause.

@cristaloleg
Copy link
Collaborator

There is a HTTPUpgrader.Timeout field which sets timeout for the dial. Is this you're asking for?

@aathan
Copy link
Author

aathan commented May 24, 2023 via email

@pascaldekloe
Copy link

The issue appears only when using SetReadTimeout on a conn from ws.Dialer, regardless whether it produced a tls.Conn or a *net.TCPConn. Nasty bug, without an error.

Using SetTimeout work fine with Go 1.22 on Darwin/ARM64.

@pascaldekloe
Copy link

Setting the timer can only be done once. Any update silently disables/breaks the functionality, whether disabled with a zero time.Time or a time in the past, or a time in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants