From 5d6ca43c9726b009d90ce1abc1b6f9d29f2ef092 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 8 Sep 2023 11:21:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=9F=E5=88=97=E7=9A=84?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- websocket.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/websocket.go b/websocket.go index 7ae390e..e67e2b8 100644 --- a/websocket.go +++ b/websocket.go @@ -41,9 +41,10 @@ func queueHandler(w http.ResponseWriter, r *http.Request) { } defer conn.Close() - log.Println("建立连接", DequeueHandler.RefCountAdd(1)) + raddr := conn.RemoteAddr() + log.Printf("%s 建立连接 当前unity处理机器数量 %d", raddr, DequeueHandler.RefCountAdd(1)) defer func() { - log.Println("退出连接", DequeueHandler.RefCountAdd(-1)) + log.Printf("%s 退出连接 当前unity处理机器数量 %d", raddr, DequeueHandler.RefCountAdd(-1)) }() for {