Skip to content

Commit

Permalink
Fix ssdp.Server.Serve not returning when closed
Browse files Browse the repository at this point in the history
  • Loading branch information
WithoutPants authored and anacrolix committed Aug 29, 2024
1 parent f7a56a9 commit a5239dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ssdp/ssdp.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,12 @@ func (me *Server) Close() {
func (me *Server) Serve() (err error) {
go me.serve()
for {
select {
case <-me.closed:
return
default:
}

addrs, err := me.Interface.Addrs()
if err != nil {
return err
Expand Down

0 comments on commit a5239dd

Please sign in to comment.