From 1740e67512ce5ff509c198c229b0825a131b5eb9 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 28 Sep 2023 10:39:22 +0900 Subject: [PATCH] read stop channel --- handlers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/handlers.go b/handlers.go index 737edb3..1ea8f45 100644 --- a/handlers.go +++ b/handlers.go @@ -87,7 +87,7 @@ func (s *Server) HandleWebsocket(w http.ResponseWriter, r *http.Request) { removeListener(ws) } s.clientsMu.Unlock() - s.Log.Infof("diconnected from %s", conn.RemoteAddr().String()) + s.Log.Infof("disconnected from %s", conn.RemoteAddr().String()) }() conn.SetReadLimit(maxMessageSize) @@ -379,6 +379,8 @@ func (s *Server) HandleWebsocket(w http.ResponseWriter, r *http.Request) { defer func() { ticker.Stop() conn.Close() + for := range stop { + } }() for {