From 88087e4c8155e122eef79a0ad311a35550684dbe Mon Sep 17 00:00:00 2001 From: Luther Wen Xu Date: Sun, 13 Oct 2019 21:31:06 +0800 Subject: [PATCH] go: Sync on WebSocket connection --- GoBot/server/hub.go | 1 + 1 file changed, 1 insertion(+) diff --git a/GoBot/server/hub.go b/GoBot/server/hub.go index 14de4d4..c1b3e77 100644 --- a/GoBot/server/hub.go +++ b/GoBot/server/hub.go @@ -12,6 +12,7 @@ var connectedUsers = make(map[string]bool) func newSession(who *websocket.Conn) { clients[who] = true + who.WriteMessage(websocket.TextMessage, []byte("sync")) } func disconnectSession(who *websocket.Conn) {