fix(ws_handler): update readPump to prevent closing client.Quit prematurely
- Added comments to clarify that the client.Quit channel should not be closed within the readPump function, as it is managed by Hub.Unregister. This change improves code safety and maintainability.
This commit is contained in:
@@ -132,7 +132,6 @@ func (h *WSHandler) HandleWebSocket(c *gin.Context) {
|
||||
func (h *WSHandler) readPump(conn *websocket.Conn, client *ws.Client) {
|
||||
defer func() {
|
||||
conn.Close()
|
||||
close(client.Quit)
|
||||
}()
|
||||
|
||||
conn.SetReadLimit(64 * 1024) // 64KB
|
||||
|
||||
Reference in New Issue
Block a user