From 782569b05bfa750ff16207bfa8c2f7078ff7b3dd Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Thu, 13 Jun 2024 12:03:25 +0200 Subject: [PATCH] Refs #20650: Add missing configurations that were lost in the review Signed-off-by: JesusPoderoso --- examples/cpp/delivery_mechanisms/PubSubApp.cpp | 5 +++++ examples/cpp/delivery_mechanisms/SubscriberApp.cpp | 12 ++++++------ test/examples/test_delivery_mechanisms.py | 2 ++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/cpp/delivery_mechanisms/PubSubApp.cpp b/examples/cpp/delivery_mechanisms/PubSubApp.cpp index 3d064672329..b9d1dc30ecf 100644 --- a/examples/cpp/delivery_mechanisms/PubSubApp.cpp +++ b/examples/cpp/delivery_mechanisms/PubSubApp.cpp @@ -116,6 +116,11 @@ PubSubApp::PubSubApp( tcp_transport_->set_WAN_address("127.0.0.1"); tcp_transport_->add_listener_port(5100); pqos.transport().user_transports.push_back(tcp_transport_); + Locator tcp_initial_peers_locator_; + tcp_initial_peers_locator_.kind = LOCATOR_KIND_TCPv4; + tcp_initial_peers_locator_.port = 5100; + eprosima::fastrtps::rtps::IPLocator::setIPv4(tcp_initial_peers_locator_, "127.0.0.1"); + pqos.wire_protocol().builtin.initialPeersList.push_back(tcp_initial_peers_locator_); break; } case CLIParser::DeliveryMechanismKind::UDP: diff --git a/examples/cpp/delivery_mechanisms/SubscriberApp.cpp b/examples/cpp/delivery_mechanisms/SubscriberApp.cpp index fcec560a996..2801703555c 100644 --- a/examples/cpp/delivery_mechanisms/SubscriberApp.cpp +++ b/examples/cpp/delivery_mechanisms/SubscriberApp.cpp @@ -92,14 +92,14 @@ SubscriberApp::SubscriberApp( } case CLIParser::DeliveryMechanismKind::TCP: { - std::shared_ptr tcp_transport_ = std::make_shared(); + Locator tcp_initial_peers_locator_; + tcp_initial_peers_locator_.kind = LOCATOR_KIND_TCPv4; + tcp_initial_peers_locator_.port = 5100; + eprosima::fastrtps::rtps::IPLocator::setIPv4(tcp_initial_peers_locator_, "127.0.0.1"); + pqos.wire_protocol().builtin.initialPeersList.push_back(tcp_initial_peers_locator_); pqos.wire_protocol().builtin.discovery_config.leaseDuration = eprosima::fastrtps::c_TimeInfinite; pqos.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod = Duration_t(5, 0); - tcp_transport_->sendBufferSize = 0; - tcp_transport_->receiveBufferSize = 0; - tcp_transport_->set_WAN_address("127.0.0.1"); - tcp_transport_->add_listener_port(5100); - pqos.transport().user_transports.push_back(tcp_transport_); + pqos.transport().user_transports.push_back(std::make_shared()); break; } case CLIParser::DeliveryMechanismKind::UDP: diff --git a/test/examples/test_delivery_mechanisms.py b/test/examples/test_delivery_mechanisms.py index 5af8d1f9d4a..4e3de37ebb2 100644 --- a/test/examples/test_delivery_mechanisms.py +++ b/test/examples/test_delivery_mechanisms.py @@ -50,6 +50,8 @@ def test_delivery_mechanisms(pub_args, sub_args, repetitions): except subprocess.TimeoutExpired: print('TIMEOUT') print(out) + + assert(ret) delivery_timeout_test_cases = [ ('--mechanism shm --ignore-local-endpoints', '--mechanism udp'),