Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
Just warn on I/O timeout not error
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshartig committed Jun 20, 2016
1 parent a5b7aeb commit 0a0d077
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ func readAndUnmarshal(c *net.UDPConn, kv llog.KV) (*lproto.TxMsg, *net.UDPAddr,
b := make([]byte, 1024)
n, addr, err := c.ReadFromUDP(b)
if err != nil {
llog.Error("error reading from udp socket", kv.Set("err", err))
fn := llog.Error
if nerr, ok := err.(net.Error); ok && nerr.Timeout() {
fn = llog.Warn
}
fn("error reading from udp socket", kv.Set("err", err))
return nil, nil, false
}

Expand Down

0 comments on commit 0a0d077

Please sign in to comment.