1
0
mirror of https://github.com/taigrr/go-fastping synced 2025-01-18 05:03:15 -08:00

fix close connection && fix sleep in chan

This commit is contained in:
Vasiliev Dmitry 2014-10-23 11:32:23 +04:00 committed by Tatsushi Demachi
parent 56843b1f9f
commit 13ddfb32b1

View File

@ -484,7 +484,15 @@ func (p *Pinger) recvICMP(conn *net.IPConn, recv chan<- *packet, ctx *context, w
} }
} }
p.debugln("recvICMP(): p.recv <- packet") p.debugln("recvICMP(): p.recv <- packet")
recv <- &packet{bytes: bytes, addr: ra}
select {
case recv <- &packet{bytes: bytes, addr: ra}:
case <-ctx.stop:
p.debugln("recvICMP(): <-ctx.stop")
wg.Done()
p.debugln("recvICMP(): wg.Done()")
return
}
} }
} }