Disconnect from servers on shutdown

master
HimbeerserverDE 2021-08-30 18:30:02 +02:00
parent e45f61fce1
commit bba3dde930
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
2 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,8 @@ func main() {
cc.Close()
}
<-cc.server().Closed()
cc.srv = nil
wg.Done()
}()
}

View File

@ -80,6 +80,7 @@ func handleSrv(sc *serverConn) {
case <-sc.client().Closed():
case <-ack:
sc.client().Close()
sc.client().srv = nil
sc.clt = nil
}
}