-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added stream flag indicates if client disconnected in middle of strea…
…ming (#1252)
- Loading branch information
1 parent
3b84a43
commit 893c6ca
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
893c6ca
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the logic for detecting client disconnection is wrong because "case <- clientGone" should return false so as to stop the stream.
I've just found this issue by today while trying to implement an SSE API in my server.
Moreover, in the realtime-chat example, the author reimplemented clientGone again in his "func stream"
https://github.com/gin-gonic/examples/blob/master/realtime-chat/main.go