Fix it even more
This commit is contained in:
parent
e3a6aecd51
commit
36e5ebc9bd
1 changed files with 3 additions and 0 deletions
3
main.go
3
main.go
|
@ -104,6 +104,9 @@ func main() {
|
||||||
pktlen, raddr, readErr := ln.ReadFromUDP(pktbuf)
|
pktlen, raddr, readErr := ln.ReadFromUDP(pktbuf)
|
||||||
// net.PacketConn.ReadFrom: "Callers should always process
|
// net.PacketConn.ReadFrom: "Callers should always process
|
||||||
// the n > 0 bytes returned before considering the error err."
|
// the n > 0 bytes returned before considering the error err."
|
||||||
|
if ctx.Err() != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
log.Printf("Received packet of length %d from %v", pktlen, raddr)
|
log.Printf("Received packet of length %d from %v", pktlen, raddr)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue