OSDN Git Service

Merge pull request #41 from Bytom/dev
[bytom/vapor.git] / p2p / netutil / error.go
1 package netutil
2
3 // isPacketTooBig reports whether err indicates that a UDP packet didn't
4 // fit the receive buffer. There is no such error on
5 // non-Windows platforms.
6 func isPacketTooBig(err error) bool {
7         return false
8 }
9
10 // IsTemporaryError checks whether the given error should be considered temporary.
11 func IsTemporaryError(err error) bool {
12         tempErr, ok := err.(interface {
13                 Temporary() bool
14         })
15         return ok && tempErr.Temporary() || isPacketTooBig(err)
16 }