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

fix: set write deadline before writing messages #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alvarowolfx
Copy link
Contributor

I was having some weird behavior here when I set up ping/pong to keep the connection alive, where even with that, I was getting disconnected after some time.

Them I checked gorilla/websocket sample on how to keep the connection alive and noticed that their base samples resets the WriteDeadline on every write, this way keeping the connection alive.
https://github.com/gorilla/websocket/blob/master/examples/chat/client.go#L91

So this commit added that behavior.

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

Successfully merging this pull request may close these issues.

1 participant