internal/server/server.go 🔗
@@ -266,6 +266,11 @@ func (r *Room) HandleConn(playerID uuid.UUID, nickname string, c *websocket.Conn
r.sendAll()
}()
+ g.Go(func() error {
+ <-ctx.Done()
+ return c.Close(websocket.StatusGoingAway, "going away")
+ })
+
g.Go(func() error {
ticker := time.NewTicker(time.Minute)
defer ticker.Stop()