diff options
Diffstat (limited to 'vendor/github.com/gorilla/websocket/examples/chat/client.go')
-rw-r--r-- | vendor/github.com/gorilla/websocket/examples/chat/client.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/github.com/gorilla/websocket/examples/chat/client.go b/vendor/github.com/gorilla/websocket/examples/chat/client.go index 26468477c..ecfd9a7aa 100644 --- a/vendor/github.com/gorilla/websocket/examples/chat/client.go +++ b/vendor/github.com/gorilla/websocket/examples/chat/client.go @@ -129,6 +129,9 @@ func serveWs(hub *Hub, w http.ResponseWriter, r *http.Request) { } client := &Client{hub: hub, conn: conn, send: make(chan []byte, 256)} client.hub.register <- client + + // Allow collection of memory referenced by the caller by doing all work in + // new goroutines. go client.writePump() - client.readPump() + go client.readPump() } |