You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Goroutine on my server that should return if the connection is closed. How can I know if it was closed? Is there a channel that is closed when that happens or something similar? I'd like to write something like this:
conn, err:=websocket.Accept(w, r, nil)
// ...select {
case<-ctx.Done():
// do something if the ctx of my function is donecasesomething: // some event selection expression that happens when conn is closed// release resources now that conn is closedreturn
}