-
Notifications
You must be signed in to change notification settings - Fork 60
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
How to detect client disconnection ? #21
Comments
You can send to client a dummy "PING" data periodically. You can't detect a disconnect without sending any data. |
Thanks for your answer. |
You can invoke |
The problem is that I don't see how to get the "conn" variable from my "ResponseWriter"/"Request". |
@Guiguillermo http://golang.org/pkg/net/http/#example_Hijacker |
The problem with Hijack() is that it takes control of the http connection, so the eventsource doesn't work anymore because it needs the http connection. |
Hello,
I'm developping chat rooms based on Twitter hashtag with Server sent events.
I have a problem concerning the disconnection of the client. I run a goroutine to send messages to the client, but when the client disconnects, the goroutine still runs.
I don't know how to detect on the server side that the client is disconnected.
You can find a part of my code here : https://gist.github.com/Guiguillermo/f214fbda9aacec1ea5d9
Thanks !
The text was updated successfully, but these errors were encountered: