X-Git-Url: https://code.octet-stream.net/broadcaster/blobdiff_plain/d14180328760fa282068927068ca5675b9427bc2..25d02cf0c3462805176f4193d675c4904221dca1:/server/radio_sync.go?ds=sidebyside diff --git a/server/radio_sync.go b/server/radio_sync.go index 9fd9a65..6eefc8b 100644 --- a/server/radio_sync.go +++ b/server/radio_sync.go @@ -1,14 +1,14 @@ package main import ( - "code.octet-stream.net/broadcaster/protocol" + "code.octet-stream.net/broadcaster/internal/protocol" "encoding/json" "golang.org/x/net/websocket" "log" ) func RadioSync(ws *websocket.Conn) { - log.Println("A websocket connected, I think") + log.Println("Radio websocket connected, not yet authenticated") buf := make([]byte, 16384) badRead := false @@ -53,6 +53,8 @@ func RadioSync(ws *websocket.Conn) { radio = r log.Println("Radio authenticated:", radio.Name) isAuthenticated = true + commandRouter.AddWebsocket(r.Id, ws) + defer commandRouter.RemoveWebsocket(ws) go KeepFilesUpdated(ws) go KeepPlaylistsUpdated(ws)