diff --git a/znet/connection.go b/znet/connection.go index df307cb..ede5239 100644 --- a/znet/connection.go +++ b/znet/connection.go @@ -158,12 +158,13 @@ func (c *Connection) Start() { //Stop 停止连接,结束当前连接状态M func (c *Connection) Stop() { - c.Lock() - defer c.Unlock() //如果用户注册了该链接的关闭回调业务,那么在此刻应该显示调用 c.TCPServer.CallOnConnStop(c) + c.Lock() + defer c.Unlock() + //如果当前链接已经关闭 if c.isClosed == true { return