Skip to content

Commit

Permalink
Do not close the readCh or exit on a closed PacketConn.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Sep 18, 2024
1 parent ff1f078 commit 9712cd5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions service/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ func (m *multiPacketListener) Acquire() (net.PacketConn, error) {
m.readCh = make(chan readRequest)
m.doneCh = make(chan struct{})
go func() {
defer close(m.readCh)
buffer := make([]byte, serverUDPBufferSize)
for {
n, addr, err := m.pc.ReadFrom(buffer)
Expand All @@ -301,9 +300,6 @@ func (m *multiPacketListener) Acquire() (net.PacketConn, error) {
case <-m.doneCh:
return
}
if errors.Is(err, net.ErrClosed) {
return
}
}
}()
}
Expand Down

0 comments on commit 9712cd5

Please sign in to comment.