From b38b33db034e67a8d6946f16527480529a7c830d Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Tue, 26 Jan 2021 21:50:15 -0800 Subject: [PATCH] raise search reply processing limit Seems pvAccessCPP likes to send lots of individual replies to our nicely batched search requests. --- src/client.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index a4ac99b..7ea956e 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -614,8 +614,11 @@ void Context::Pvt::onSearchS(evutil_socket_t fd, short evt, void *raw) if(!(evt&EV_READ)) return; - // handle up to 4 packets before going back to the reactor - for(unsigned i=0; i<4 && static_cast(raw)->onSearch(); i++) {} + // limit number of packets processed before going back to the reactor + unsigned i; + const unsigned limit = 40; + for(i=0; i(raw)->onSearch(); i++) {} + log_debug_printf(io, "UDP search processed %u/%u\n", i, limit); }catch(std::exception& e){ log_exc_printf(io, "Unhandled error in search Rx callback: %s\n", e.what());