From 81fb39606b069fbece973995572fa7f90ea1950a Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 14 May 2020 20:21:02 +0200 Subject: [HICN-613] Add io_service to ConsumerSocket constructor. Change-Id: Ic1952388e1d2b1e7457c71ae8a959d97aa0cd2d6 Signed-off-by: Mauro Sardara --- .../hicn/transport/interfaces/socket_consumer.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'libtransport/includes/hicn/transport/interfaces/socket_consumer.h') diff --git a/libtransport/includes/hicn/transport/interfaces/socket_consumer.h b/libtransport/includes/hicn/transport/interfaces/socket_consumer.h index 73cbb78b0..2447f9b5b 100644 --- a/libtransport/includes/hicn/transport/interfaces/socket_consumer.h +++ b/libtransport/includes/hicn/transport/interfaces/socket_consumer.h @@ -145,7 +145,7 @@ class ConsumerSocket { * @param protocol - The transport protocol to use. So far the following * transport are supported: * - CBR: Constant bitrate - * - Raaqm: Based on paper: Optimal multipath congestion control and request + * - RAAQM: Based on paper: Optimal multipath congestion control and request * forwarding in information-centric networks: Protocol design and * experimentation. G Carofiglio, M Gallo, L Muscariello. Computer Networks * 110, 104-117 @@ -153,6 +153,25 @@ class ConsumerSocket { */ explicit ConsumerSocket(int protocol); + /** + * @brief Create a new consumer socket, passing an io_service to it. + * Passing an io_service means that the caller must explicitely call + * io_service.run() for the consumer to start. Any call to consume won't be + * blocking. This can be used in case we want to share a single thread + * among multiple consumer sockets. The caller MUST ensure the provided + * io_service will outlive the ConsumerSocket. + * + * @param protocol - The transport protocol to use. So far the following + * transport are supported: + * - CBR: Constant bitrate + * - RAAQM: Based on paper: Optimal multipath congestion control and request + * forwarding in information-centric networks: Protocol design and + * experimentation. G Carofiglio, M Gallo, L Muscariello. Computer Networks + * 110, 104-117 + * - RTC: Real time communication + */ + explicit ConsumerSocket(int protocol, asio::io_service &io_service); + /** * @brief Destroy the consumer socket. */ -- cgit 1.2.3-korg