From 5091a1018c208c4e26c78f9314b29026e07a381e Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 8 Sep 2023 11:41:16 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=97=A5=E5=BF=97=E7=9A=84=E6=89=93?= =?UTF-8?q?=E5=8D=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- websocket.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) } }