From: mtk Date: Wed, 19 Oct 2011 19:13:58 +0000 (+0000) Subject: added a flush() member to ActiveBurstSocketSource X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=0e6076544fbcaba94b6339f0074cb2adcd56d515;p=senf.git added a flush() member to ActiveBurstSocketSource git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1817 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/PPI/SocketSource.ct b/senf/PPI/SocketSource.ct index 00f5564..946515b 100644 --- a/senf/PPI/SocketSource.ct +++ b/senf/PPI/SocketSource.ct @@ -143,6 +143,20 @@ prefix_ void senf::ppi::module::ActiveBurstSocketSource::read() } } +template +prefix_ void senf::ppi::module::ActiveBurstSocketSource::flush() +{ + try{ + while( true){ + typename Reader::PacketType p(reader_(handle_)); + if (p.data().size() <= 0) + break; + } + } + catch(...){}; +} + + //-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ diff --git a/senf/PPI/SocketSource.hh b/senf/PPI/SocketSource.hh index 51ffa01..8ef7b99 100644 --- a/senf/PPI/SocketSource.hh +++ b/senf/PPI/SocketSource.hh @@ -146,6 +146,7 @@ namespace module { ///< Set handle /**< Assigning an empty or in-valid() handle will disable the module until a new, valid handle is assigned. */ + private: Handle handle_; IOEvent event_; @@ -182,6 +183,8 @@ namespace module { unsigned maxBurst() const; void maxBurst(unsigned max_burst); + void flush(); + private: Handle handle_; IOEvent event_;