Skip to content

Commit 8e9292e

Browse files
Fix socket buffer size handling (#5926)
* [23459] test_UDPv4Transport set socket buffer size and max_msgs_size Signed-off-by: Eugenio Collado <[email protected]> * [23459] Remove buffer size upper limit Signed-off-by: Eugenio Collado <[email protected]> * [23459] Remopve unnecesary lines Signed-off-by: Eugenio Collado <[email protected]> * [23459] Add removed comment Signed-off-by: Eugenio Collado <[email protected]> * [23459] test_UDPv4 dr using builtin transport with modified buffer size Signed-off-by: Eugenio Collado <[email protected]> --------- Signed-off-by: Eugenio Collado <[email protected]>
1 parent 4e929b0 commit 8e9292e

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/cpp/rtps/transport/asio_helpers.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ struct asio_helpers
8787
if (!ec)
8888
{
8989
// Last attempt was successful. Get the actual value set.
90-
int32_t max_value = static_cast<int32_t>(initial_buffer_value);
9190
BufferOptionType option;
9291
socket.get_option(option, ec);
93-
if (!ec && (option.value() >= value_to_set) && (option.value() <= max_value))
92+
if (!ec && (option.value() >= value_to_set))
9493
{
9594
final_buffer_value = option.value();
9695
return true;

src/cpp/rtps/transport/test_UDPv4Transport.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ test_UDPv4Transport::test_UDPv4Transport(
5959

6060
test_transport_options->test_UDPv4Transport_DropLogLength = 0;
6161
test_transport_options->test_UDPv4Transport_ShutdownAllNetwork = false;
62-
UDPv4Transport::mSendBufferSize = descriptor.sendBufferSize;
63-
UDPv4Transport::mReceiveBufferSize = descriptor.receiveBufferSize;
62+
UDPv4Transport::configuration_.sendBufferSize = descriptor.sendBufferSize;
63+
UDPv4Transport::configuration_.receiveBufferSize = descriptor.receiveBufferSize;
64+
UDPv4Transport::configuration_.maxMessageSize = descriptor.maxMessageSize;
6465
for (auto interf : descriptor.interfaceWhiteList)
6566
{
6667
UDPv4Transport::interface_whitelist_.emplace_back(asio::ip::make_address_v4(interf));

test/blackbox/common/DDSBlackboxTestsListeners.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -796,12 +796,8 @@ void sample_lost_test_dr_init(
796796
PubSubReader<T>& reader,
797797
std::function<void(const eprosima::fastdds::dds::SampleLostStatus& status)> functor)
798798
{
799-
auto udp_transport = std::make_shared<UDPv4TransportDescriptor>();
800-
udp_transport->sendBufferSize = SAMPLE_LOST_TEST_BUFFER_SIZE;
801-
udp_transport->receiveBufferSize = SAMPLE_LOST_TEST_BUFFER_SIZE;
802799

803-
reader.disable_builtin_transport()
804-
.add_user_transport_to_pparams(udp_transport)
800+
reader.socket_buffer_size(SAMPLE_LOST_TEST_BUFFER_SIZE)
805801
.sample_lost_status_functor(functor)
806802
.init();
807803

@@ -814,9 +810,6 @@ void sample_lost_test_init(
814810
PubSubWriter<T>& writer,
815811
std::function<void(const eprosima::fastdds::dds::SampleLostStatus& status)> functor)
816812
{
817-
reader.socket_buffer_size(SAMPLE_LOST_TEST_BUFFER_SIZE);
818-
writer.socket_buffer_size(SAMPLE_LOST_TEST_BUFFER_SIZE);
819-
820813
sample_lost_test_dw_init(writer);
821814
sample_lost_test_dr_init(reader, functor);
822815

0 commit comments

Comments
 (0)