mirror of https://github.com/gorilla/websocket.git
[Examples\Chat] Allow to free HTTP conn things
This commit is contained in:
parent
a91eba7f97
commit
55a83f0ee3
|
@ -127,8 +127,11 @@ func serveWs(hub *Hub, w http.ResponseWriter, r *http.Request) {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
client := &Client{hub: hub, conn: conn, send: make(chan []byte, 256)}
|
client := &Client{hub: hub, conn: conn, send: make(chan []byte, 256)}
|
||||||
client.hub.register <- client
|
client.hub.register <- client
|
||||||
|
|
||||||
|
// exit from serveWs, now HTTP server can free unneeded things
|
||||||
go client.writePump()
|
go client.writePump()
|
||||||
client.readPump()
|
go client.readPump()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue