Browse Source

去掉重复关闭

master
Aceld 4 years ago
parent
commit
c493b201ed
  1. 4
      znet/connection.go

4
znet/connection.go

@ -161,6 +161,7 @@ func (c *Connection) Stop() {
c.Lock()
defer c.Unlock()
//如果用户注册了该链接的关闭回调业务,那么在此刻应该显示调用
c.TCPServer.CallOnConnStop(c)
//如果当前链接已经关闭
@ -170,9 +171,6 @@ func (c *Connection) Stop() {
fmt.Println("Conn Stop()...ConnID = ", c.ConnID)
//如果用户注册了该链接的关闭回调业务,那么在此刻应该显示调用
c.TCPServer.CallOnConnStop(c)
// 关闭socket链接
c.Conn.Close()
//关闭Writer

Loading…
Cancel
Save