From 127aca402324c150445be92125feeb6f9f4cb25e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 18 Jul 2015 04:46:45 +0200 Subject: some cleanup diff --git a/src/helsinki.at/rhrdtime/rhrdtime.go b/src/helsinki.at/rhrdtime/rhrdtime.go index e426c42..3501942 100644 --- a/src/helsinki.at/rhrdtime/rhrdtime.go +++ b/src/helsinki.at/rhrdtime/rhrdtime.go @@ -85,12 +85,12 @@ func handleNTPClient(w http.ResponseWriter, r *http.Request) { fmt.Println(err) return } - fmt.Println("Client connected", ws.RemoteAddr()) + fmt.Println("Client", ws.RemoteAddr(), "connected") for { msgtype, msg, err := ws.ReadMessage() if err != nil { - fmt.Println("Client connected", ws.RemoteAddr()) + fmt.Println("Client", ws.RemoteAddr(), "disconnected:", err) return } now_t2 := time.Now() @@ -98,7 +98,7 @@ func handleNTPClient(w http.ResponseWriter, r *http.Request) { var n ntpMessage if err := json.Unmarshal(msg, &n); err != nil { - fmt.Println("mallformed NTP message", err) + fmt.Println("ignoring mallformed (", err, ") NTP message from:", ws.RemoteAddr()) continue } diff --git a/test/index.html b/test/index.html index 031b458..42657a1 100644 --- a/test/index.html +++ b/test/index.html @@ -31,12 +31,6 @@ } function init() { - var tusock = new WebSocket("ws://localhost:3000/time"); - - tusock.onmessage = function (event) { - $('#tudata').text(event.data); - } - ntp = new NTP(); setInterval(ntp.update.bind(ntp), 1000); } @@ -44,10 +38,6 @@ -

Radio Helsinki Rivendell Time:

- -
-

Radio Helsinki Rivendell NTP:

-- cgit v0.10.2