Browse Source

close all UDP connections when the reuse is closed

pull/1424/head
Marten Seemann 3 years ago
parent
commit
c5cfb13007
  1. 10
      p2p/transport/quic/reuse.go

10
p2p/transport/quic/reuse.go

@ -193,5 +193,15 @@ func (r *reuse) Listen(network string, laddr *net.UDPAddr) (*reuseConn, error) {
func (r *reuse) Close() error {
close(r.closeChan)
<-r.gcStopChan
r.mutex.Lock()
for _, conn := range r.global {
conn.Close()
}
for _, conns := range r.unicast {
for _, conn := range conns {
conn.Close()
}
}
r.mutex.Unlock()
return nil
}

Loading…
Cancel
Save