add waitGroups for waiting finish all connects #131

Merged
vtolstov merged 7 commits from devstigneev/micro-server-tcp:issue_130 into v3 2024-03-13 15:36:35 +03:00
Showing only changes of commit d7288c7130 - Show all commits

3
tcp.go
View File

@ -430,13 +430,12 @@ func (h *tcpServer) gracefulStop() {
done := make(chan struct{})
go func() {
h.opts.Wait.Wait()
done <- struct{}{}
close(done)
}()
select {
case <-tm.C:
case <-done:
close(done)
}
}