刘丹冰
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
3 deletions
-
znet/connmanager.go
-
znet/server.go
|
|
@ -78,7 +78,7 @@ func (connMgr *ConnManager) ClearConn() { |
|
|
|
func (connMgr *ConnManager) ClearOneConn(connID uint32) { |
|
|
|
connections:=connMgr.connections.Load().(map[uint32]ziface.IConnection) |
|
|
|
|
|
|
|
if conn, ok := connections[connID]; !ok { |
|
|
|
if conn, ok := connections[connID]; ok { |
|
|
|
//停止
|
|
|
|
conn.Stop() |
|
|
|
//删除
|
|
|
|
|
|
@ -85,8 +85,7 @@ func (s *Server) Start() { |
|
|
|
//2 监听服务器地址
|
|
|
|
listener, err := net.ListenTCP(s.IPVersion, addr) |
|
|
|
if err != nil { |
|
|
|
fmt.Println("listen", s.IPVersion, "err", err) |
|
|
|
return |
|
|
|
panic(err) |
|
|
|
} |
|
|
|
|
|
|
|
//已经监听成功
|
|
|
|