aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/udp.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-11-22 01:39:36 +0800
committerFelix Lange <fjl@twurst.com>2016-11-23 05:21:15 +0800
commitba2884f3431312c616e21f57deeb03a7c4374d57 (patch)
tree112b5586fe409d5b0a5c02b4c98ebcfab9a0e6b6 /p2p/discover/udp.go
parent1d80155d5e036a0c10dd456ae2772dfa17338b95 (diff)
downloaddexon-ba2884f3431312c616e21f57deeb03a7c4374d57.tar
dexon-ba2884f3431312c616e21f57deeb03a7c4374d57.tar.gz
dexon-ba2884f3431312c616e21f57deeb03a7c4374d57.tar.bz2
dexon-ba2884f3431312c616e21f57deeb03a7c4374d57.tar.lz
dexon-ba2884f3431312c616e21f57deeb03a7c4374d57.tar.xz
dexon-ba2884f3431312c616e21f57deeb03a7c4374d57.tar.zst
dexon-ba2884f3431312c616e21f57deeb03a7c4374d57.zip
p2p/discover, p2p/discv5: use netutil.IsTemporaryError
Diffstat (limited to 'p2p/discover/udp.go')
-rw-r--r--p2p/discover/udp.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/p2p/discover/udp.go b/p2p/discover/udp.go
index 74758b6fd..b48f16229 100644
--- a/p2p/discover/udp.go
+++ b/p2p/discover/udp.go
@@ -479,13 +479,6 @@ func encodePacket(priv *ecdsa.PrivateKey, ptype byte, req interface{}) ([]byte,
return packet, nil
}
-func isTemporaryError(err error) bool {
- tempErr, ok := err.(interface {
- Temporary() bool
- })
- return ok && tempErr.Temporary() || isPacketTooBig(err)
-}
-
// readLoop runs in its own goroutine. it handles incoming UDP packets.
func (t *udp) readLoop() {
defer t.conn.Close()
@@ -495,7 +488,7 @@ func (t *udp) readLoop() {
buf := make([]byte, 1280)
for {
nbytes, from, err := t.conn.ReadFromUDP(buf)
- if isTemporaryError(err) {
+ if netutil.IsTemporaryError(err) {
// Ignore temporary read errors.
glog.V(logger.Debug).Infof("Temporary read error: %v", err)
continue