Skip to content

Commit

Permalink
Make Shutdown blocking to ensure outstanding requests processing comp…
Browse files Browse the repository at this point in the history
…letion
  • Loading branch information
pin committed Oct 28, 2023
1 parent 4baa433 commit 4b9cd87
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ func (s *Server) Shutdown() {
s.Unlock()
}
s.cancelFn()
s.wg.Wait()
if !s.singlePort {
s.wg.Wait()
}
}

func (s *Server) handlePacket(localAddr net.IP, remoteAddr *net.UDPAddr, buffer []byte, n, maxBlockLen int, listener chan []byte) error {
Expand Down

0 comments on commit 4b9cd87

Please sign in to comment.