diff --git a/server.go b/server.go index 7a67cf3b4..81580d1e5 100644 --- a/server.go +++ b/server.go @@ -476,6 +476,9 @@ func (srv *Server) serveTCP(l net.Listener) error { if !srv.isStarted() { return nil } + if neterr, ok := err.(net.Error); ok && neterr.Temporary() { + continue + } return err } srv.lock.Lock() @@ -532,6 +535,9 @@ func (srv *Server) serveUDP(l net.PacketConn) error { if !srv.isStarted() { return nil } + if netErr, ok := err.(net.Error); ok && netErr.Temporary() { + continue + } return err } if len(m) < headerSize {