Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruens committed Sep 16, 2024
1 parent 0b59061 commit 70cf8f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion service/listeners.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ func (pc *virtualPacketConn) Close() error {
if pc.readCh == nil {
return nil
}

close(pc.closeCh)
pc.readCh = nil
return nil
Expand Down Expand Up @@ -293,7 +294,11 @@ func (m *multiPacketListener) Acquire() (net.PacketConn, error) {
go func() {
for {
select {
case req := <-m.readCh:
case req, ok := <-m.readCh:
if !ok {
// The read channel is closed.
return
}
n, addr, err := m.pc.ReadFrom(req.buffer)
req.respCh <- struct {
n int
Expand Down

0 comments on commit 70cf8f8

Please sign in to comment.