diff --git a/websocket.go b/websocket.go index 2b91443..d9ddddb 100644 --- a/websocket.go +++ b/websocket.go @@ -32,6 +32,9 @@ func HttpListen(ns *dragonboat.NodeHost, port int) { } func queueHandler(w http.ResponseWriter, r *http.Request) { + + var count int + var err error conn, err := upgrader.Upgrade(w, r, nil) if err != nil { @@ -85,6 +88,8 @@ func queueHandler(w http.ResponseWriter, r *http.Request) { stateClient.PushItem(nil, item) return } + count++ + log.Println("count:", count) // 打印消息 log.Printf("source: [%s] 数据 推送到unity [%s]\n", item.Source, raddr.String())