From adf290ca2a7da0652735bfb4f6e3b433ecec1e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <1@72wo.cn> Date: Fri, 12 Dec 2025 13:16:30 +0800 Subject: [PATCH] =?UTF-8?q?```=20fix(socket):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E4=BA=8B=E4=BB=B6=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=95=B0=E6=97=A5=E5=BF=97=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将 OnTick 方法中的日志输出从 "[connected-count=%v]" 更改为更直观的 "链接数" 描述, 便于理解和调试连接状态。 ``` --- common/socket/ServerEvent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/socket/ServerEvent.go b/common/socket/ServerEvent.go index f8506adf9..f57758f42 100644 --- a/common/socket/ServerEvent.go +++ b/common/socket/ServerEvent.go @@ -77,7 +77,7 @@ func (s *Server) OnClose(c gnet.Conn, err error) (action gnet.Action) { return } func (s *Server) OnTick() (delay time.Duration, action gnet.Action) { - glog.Infof(context.Background(), gtime.Now().ISO8601(), "[connected-count=%v]", atomic.LoadInt64(&s.connected)) + glog.Infof(context.Background(), gtime.Now().ISO8601(), "链接数", atomic.LoadInt64(&s.connected)) if s.quit && atomic.LoadInt64(&s.connected) == 0 { //执行正常退出逻辑 os.Exit(0)