From 674c38a066ac17719019a70c02a6de11a3847208 Mon Sep 17 00:00:00 2001 From: kercylan98 Date: Sat, 9 Sep 2023 13:10:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20server.Conn=20?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=85=B3=E9=97=AD=E6=97=B6=E5=8F=91=E7=94=9F?= =?UTF-8?q?=E7=9A=84=E7=AB=9E=E6=80=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/conn.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/conn.go b/server/conn.go index afa73d7..96e2ff0 100644 --- a/server/conn.go +++ b/server/conn.go @@ -169,6 +169,8 @@ func (slf *Conn) IsClosed() bool { // Close 关闭连接 func (slf *Conn) Close(err ...error) { slf.close.Do(func() { + slf.mutex.Lock() + defer slf.mutex.Unlock() slf.closed = true if slf.ws != nil { _ = slf.ws.Close()