fix: kcp protocol cause delay release resource (#2621)

Co-authored-by: blizard863 <760076784@qq.com>
This commit is contained in:
Blizard
2021-10-19 14:57:26 +08:00
committed by GitHub
parent 998e678a7f
commit 1d26ea440b
3 changed files with 15 additions and 5 deletions

View File

@@ -124,8 +124,7 @@ func handleSignal(svr *client.Service) {
ch := make(chan os.Signal)
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM)
<-ch
svr.Close()
time.Sleep(250 * time.Millisecond)
svr.Close(time.Millisecond * 250)
close(kcpDoneCh)
}