Chore: Ensure websocket connection is closed on client unregistration

This commit is contained in:
Ralph Slooten
2026-05-09 17:02:48 +12:00
parent b997fff7eb
commit 71bd44bbb5

View File

@@ -56,6 +56,7 @@ type Client struct {
func (c *Client) readPump() {
defer func() {
c.hub.unregister <- c
c.conn.Close()
}()
for {
@@ -79,6 +80,7 @@ func (c *Client) writePump() {
defer func() {
ticker.Stop()
c.hub.unregister <- c
c.conn.Close()
}()
for {
select {