diff --git a/websocket.go b/websocket.go index a4d7a76..ae05aca 100644 --- a/websocket.go +++ b/websocket.go @@ -42,6 +42,7 @@ func queueHandler(w http.ResponseWriter, r *http.Request) { defer conn.Close() raddr := conn.RemoteAddr() + // laddr := conn.LocalAddr() log.Printf("%s 建立连接 当前unity处理机器数量 %d", raddr, DequeueHandler.RefCountAdd(1)) defer func() { log.Printf("%s 退出连接 当前unity处理机器数量 %d", raddr, DequeueHandler.RefCountAdd(-1)) @@ -50,7 +51,6 @@ func queueHandler(w http.ResponseWriter, r *http.Request) { for { item := <-PopChannel - if item == nil { continue } @@ -87,7 +87,7 @@ func queueHandler(w http.ResponseWriter, r *http.Request) { } // 打印消息 - fmt.Printf("%s 的数据 推送到unity. source: [%s]\n", conn.RemoteAddr(), item.Source) + fmt.Printf("数据 推送到unity %s. source: [%s]\n", raddr, item.Source) } }