diff options
Diffstat (limited to 'host/lib/transport')
-rw-r--r-- | host/lib/transport/usb_zero_copy_wrapper.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/host/lib/transport/usb_zero_copy_wrapper.cpp b/host/lib/transport/usb_zero_copy_wrapper.cpp index d04244ca9..ec5667020 100644 --- a/host/lib/transport/usb_zero_copy_wrapper.cpp +++ b/host/lib/transport/usb_zero_copy_wrapper.cpp @@ -176,6 +176,14 @@ public: } managed_recv_buffer::sptr get_recv_buff(double timeout){ + //lazy flush mechanism - negative timeout + if (timeout < 0.0) + { + _last_recv_buff.reset(); + while (_internal_zc->get_recv_buff()){} + return managed_recv_buffer::sptr(); + } + //attempt to get a managed recv buffer if (not _last_recv_buff){ _last_recv_buff = _internal_zc->get_recv_buff(timeout); |