From d7c64eb4b13670dbc5728f994e70dca60616af63 Mon Sep 17 00:00:00 2001 From: michael-west Date: Tue, 7 Jul 2020 13:37:25 -0700 Subject: RFNoC: Add xport disconnect callbacks Transports were not disconnecting their links from the I/O service upon destruction, leaving behind inaccessible send and recv links used by nothing. This led to I/O errors after creating several transports. Added callbacks to transports to automatically disconnect their links from the I/O service when the transport is destroyed. Updated all callers to supply a disconnect callback. Signed-off-by: michael-west --- host/lib/include/uhdlib/transport/io_service.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'host/lib/include/uhdlib/transport/io_service.hpp') diff --git a/host/lib/include/uhdlib/transport/io_service.hpp b/host/lib/include/uhdlib/transport/io_service.hpp index 62dfdfe0d..0cc2f86e3 100644 --- a/host/lib/include/uhdlib/transport/io_service.hpp +++ b/host/lib/include/uhdlib/transport/io_service.hpp @@ -77,6 +77,13 @@ namespace uhd { namespace transport { using recv_callback_t = std::function; +/*! + * Callback to disconnect links. This allows a function to be registered + * that can call back to the io_service_mgr to completely disconnect the + * links. + */ +using disconnect_callback_t = std::function; + /*! * Interface for a recv transport to request/release buffers from a link. A * recv transport is a transport with a primary purpose of receiving data, and -- cgit v1.2.3