txlyre 1 mese fa
parent
commit
3cdbc04f68
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      main.go

+ 3 - 1
main.go

@@ -37,7 +37,9 @@ func sender(queue chan []byte, secret string, cooldown uint) {
 			data := <-queue
 
 			if err := ws.WriteMessage(websocket.BinaryMessage, data); err != nil {
-				log.Println("WriteMessage() failed")
+				if websocket.IsUnexpectedCloseError(err, websocket.CloseGoingAway, websocket.CloseAbnormalClosure) {
+					log.Println("connection lost")
+				}
 
 				break
 			}