From: Remi Gacogne Date: Mon, 5 Oct 2020 12:38:00 +0000 (+0200) Subject: mplexer: Add a method to inspect the monitored descriptors X-Git-Tag: auth-4.5.0-alpha0~14^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f75b8a3b95f4b06ffe0f7b16b6552e1b10560b6e;p=thirdparty%2Fpdns.git mplexer: Add a method to inspect the monitored descriptors --- diff --git a/pdns/mplexer.hh b/pdns/mplexer.hh index a948c9f075..9408a2ad37 100644 --- a/pdns/mplexer.hh +++ b/pdns/mplexer.hh @@ -178,6 +178,16 @@ public: return writeFDs ? d_writeCallbacks.size() : d_readCallbacks.size(); } + void runForAllWatchedFDs(void(*watcher)(bool isRead, int fd, const funcparam_t&, struct timeval)) + { + for (const auto& entry : d_readCallbacks) { + watcher(true, entry.d_fd, entry.d_parameter, entry.d_ttd); + } + for (const auto& entry : d_writeCallbacks) { + watcher(false, entry.d_fd, entry.d_parameter, entry.d_ttd); + } + } + protected: struct FDBasedTag {}; struct TTDOrderedTag {};