aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discv5/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/discv5/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/discv5/udp.go')
-rw-r--r--p2p/discv5/udp.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go
index 46d3200bf..f86fb4d81 100644
--- a/p2p/discv5/udp.go
+++ b/p2p/discv5/udp.go
@@ -385,7 +385,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
@@ -398,13 +398,6 @@ func (t *udp) readLoop() {
}
}
-func isTemporaryError(err error) bool {
- tempErr, ok := err.(interface {
- Temporary() bool
- })
- return ok && tempErr.Temporary() || isPacketTooBig(err)
-}
-
func (t *udp) handlePacket(from *net.UDPAddr, buf []byte) error {
pkt := ingressPacket{remoteAddr: from}
if err := decodePacket(buf, &pkt); err != nil {