aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/deps/rpclib
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2020-10-09 11:25:55 +0200
committerAaron Rossetto <aaron.rossetto@ni.com>2020-10-09 12:31:33 -0500
commite760e5372b090cf0ba22530e155220200536a8fe (patch)
tree058bf2f5311a3b2d18f70869ef6908a5f3508a77 /host/lib/deps/rpclib
parent67651b9fffa6e6728a70348d0d174c3c0f802bfc (diff)
downloaduhd-e760e5372b090cf0ba22530e155220200536a8fe.tar.gz
uhd-e760e5372b090cf0ba22530e155220200536a8fe.tar.bz2
uhd-e760e5372b090cf0ba22530e155220200536a8fe.zip
deps: rpclib: Fix issue on socket closing
The rpclib server session closes its socket, which can fail. In our case, we only use the server for some tests, and we close the server on process exit, so we let the error slide. Since we close servers in dtors, not doing so would occasionally cause SIGABRT.
Diffstat (limited to 'host/lib/deps/rpclib')
-rw-r--r--host/lib/deps/rpclib/lib/rpc/detail/server_session.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/host/lib/deps/rpclib/lib/rpc/detail/server_session.cc b/host/lib/deps/rpclib/lib/rpc/detail/server_session.cc
index 3f1ed48c9..7de8bd213 100644
--- a/host/lib/deps/rpclib/lib/rpc/detail/server_session.cc
+++ b/host/lib/deps/rpclib/lib/rpc/detail/server_session.cc
@@ -33,7 +33,13 @@ void server_session::start() { do_read(); }
void server_session::close() {
LOG_INFO("Closing session.");
exit_ = true;
- write_strand_.post([this]() { socket_.close(); });
+ write_strand_.post([this]() {
+ try {
+ socket_.close();
+ } catch (const boost::system::system_error&) {
+ LOG_WARN("Error during closing socket.");
+ }
+ });
}
void server_session::do_read() {