From 19eb33a7e2954778d1e680f26893fc7021205d4a Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 4 Dec 2020 13:50:05 +0100 Subject: [PATCH] Add a AdHocSocketHandler::receive_multi overload With only a single callback. --- src/common/communication/common.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/common/communication/common.h b/src/common/communication/common.h index 578f5b39..bcdbed84 100644 --- a/src/common/communication/common.h +++ b/src/common/communication/common.h @@ -542,8 +542,6 @@ class AdHocSocketHandler { * same thing as `primary_callback`, but secondary sockets may need some * different handling. * - * TODO: Add an overload with a single callback - * * @tparam F A function type in the form of * `void(boost::asio::local::stream_protocol::socket&)`. * @tparam G The same as `F`. @@ -619,6 +617,18 @@ class AdHocSocketHandler { acceptor.reset(); } + /** + * The same as the above, but with a single callback for incoming + * connections on the primary socket and on secondary sockets. + * + * @overload + */ + template + void receive_multi(std::optional> logging, + F callback) { + receive_multi(logging, callback, callback); + } + private: /** * Used in `receive_multi()` to asynchronously listen for secondary socket