diff --git a/handler/tool.go b/handler/tool.go index 27d6a49..252e395 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -195,14 +195,13 @@ func subscribeAndHandleMessagesV6(ws *websocket.Conn, deviceId int) { count := 0 //定时器,发送计数器 tCount := 0 - var buf []byte //计算帧率 for { //从service获取当前帧 c := service.DeviceFrameCount[deviceId] if c != count { count = c - buf = service.Device1CurrentFrame.ToBytes() + buf := service.Device1CurrentFrame.ToBytes() err2 := ws.WriteMessage(websocket.BinaryMessage, buf) if err2 != nil { log.Printf("send message to client err:%v", err2)