From 35c6d742977fa03e840d70951c0a136720d8a2d0 Mon Sep 17 00:00:00 2001 From: DaulPavid <paul.david@ettus.com> Date: Tue, 9 Feb 2016 14:17:43 -0800 Subject: Corrected the UHD behavior in the event of a USB disconnect --- host/examples/benchmark_rate.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'host/examples') diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp index cc3ef04a4..f8c0342c0 100644 --- a/host/examples/benchmark_rate.cpp +++ b/host/examples/benchmark_rate.cpp @@ -80,6 +80,12 @@ void benchmark_rx_rate( try { num_rx_samps += rx_stream->recv(buffs, max_samps_per_packet, md)*rx_stream->get_num_channels(); } + catch (uhd::io_error &e) { + std::cerr << "Caught an IO exception. " << std::endl; + std::cerr << e.what() << std::endl; + + return; + } catch (...) { /* apparently, the boost thread interruption can sometimes result in throwing exceptions not of type boost::exception, this catch allows -- cgit v1.2.3