diff --git a/lmux/lmux.go b/lmux/lmux.go index 1368a0b1..58791dd7 100644 --- a/lmux/lmux.go +++ b/lmux/lmux.go @@ -75,7 +75,7 @@ func (lm *ListenerMux) Start() { c, err := l.Accept() if err != nil { var ne net.Error - if ok := errors.As(err, &ne); ok && ne.Timeout() { + if ok := errors.As(err, &ne); ok && ne.Temporary() { logging.Error("Accept failed: temporary error, retrying...") time.Sleep(time.Second / 20) continue diff --git a/nbhttp/engine.go b/nbhttp/engine.go index 3a38ff9a..8164db0c 100644 --- a/nbhttp/engine.go +++ b/nbhttp/engine.go @@ -281,7 +281,7 @@ func (e *Engine) listen(ln net.Listener, tlsConfig *tls.Config, addConn func(net addConn(conn, tlsConfig, decrease) } else { var ne net.Error - if ok := errors.As(err, &ne); ok && ne.Timeout() { + if ok := errors.As(err, &ne); ok && ne.Temporary() { logging.Error("Accept failed: temporary error, retrying...") time.Sleep(time.Second / 20) } else { diff --git a/poller_epoll.go b/poller_epoll.go index 9334f8ad..1a93208c 100644 --- a/poller_epoll.go +++ b/poller_epoll.go @@ -140,7 +140,7 @@ func (p *poller) acceptorLoop() { p.g.pollers[c.Hash()%len(p.g.pollers)].addConn(c) } else { var ne net.Error - if ok := errors.As(err, &ne); ok && ne.Timeout() { + if ok := errors.As(err, &ne); ok && ne.Temporary() { logging.Error("NBIO[%v][%v_%v] Accept failed: temporary error, retrying...", p.g.Name, p.pollType, p.index) time.Sleep(time.Second / 20) } else { diff --git a/poller_std.go b/poller_std.go index 053863ea..8b8b8f04 100644 --- a/poller_std.go +++ b/poller_std.go @@ -109,7 +109,7 @@ func (p *poller) start() { for !p.shutdown { err = p.accept() if err != nil { - if ne, ok := err.(net.Error); ok && ne.Timeout() { + if ne, ok := err.(net.Error); ok && ne.Temporary() { logging.Error("NBIO[%v][%v_%v] Accept failed: temporary error, retrying...", p.g.Name, p.pollType, p.index) time.Sleep(time.Second / 20) } else {