diff options
author | DaulPavid <paul.david@ettus.com> | 2016-02-09 14:17:43 -0800 |
---|---|---|
committer | DaulPavid <paul.david@ettus.com> | 2016-02-12 13:32:38 -0800 |
commit | 35c6d742977fa03e840d70951c0a136720d8a2d0 (patch) | |
tree | 1ed57b259eeb883ec135ef96c833a52ef6b3d7f4 /host/examples | |
parent | 83c1493e031ddd0b5b80560f4345aaa089446f94 (diff) | |
download | uhd-35c6d742977fa03e840d70951c0a136720d8a2d0.tar.gz uhd-35c6d742977fa03e840d70951c0a136720d8a2d0.tar.bz2 uhd-35c6d742977fa03e840d70951c0a136720d8a2d0.zip |
Corrected the UHD behavior in the event of a USB disconnect
Diffstat (limited to 'host/examples')
-rw-r--r-- | host/examples/benchmark_rate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 |