Skip to content

Commit

Permalink
Refs #21036. Fix conflicts.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany committed May 24, 2024
1 parent 47de654 commit f7a3d2c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 106 deletions.
28 changes: 0 additions & 28 deletions src/cpp/rtps/transport/TCPTransportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,35 +517,7 @@ bool TCPTransportInterface::init(
if (!asio_helpers::configure_buffer_sizes(
*initial_peer_local_locator_socket_, *configuration(), send_size, recv_size))
{
<<<<<<< HEAD
socket_base::send_buffer_size option;
initial_peer_local_locator_socket_->get_option(option);
set_send_buffer_size(option.value());

if (configuration()->sendBufferSize < s_minimumSocketBuffer)
{
set_send_buffer_size(s_minimumSocketBuffer);
}
}

if (configuration()->receiveBufferSize == 0)
{
socket_base::receive_buffer_size option;
initial_peer_local_locator_socket_->get_option(option);
set_receive_buffer_size(option.value());

if (configuration()->receiveBufferSize < s_minimumSocketBuffer)
{
set_receive_buffer_size(s_minimumSocketBuffer);
}
}

if (configuration()->maxMessageSize > s_maximumMessageSize)
{
EPROSIMA_LOG_ERROR(RTCP_MSG_OUT, "maxMessageSize cannot be greater than 65000");
=======
EPROSIMA_LOG_ERROR(TRANSPORT_TCP, "Couldn't set buffer sizes to minimum value: " << cfg_max_msg_size);
>>>>>>> 53cd211a8 (Handle errors when setting socket buffer sizes (#4760) (#4796))
return false;
}

Expand Down
49 changes: 3 additions & 46 deletions src/cpp/rtps/transport/UDPTransportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,44 +122,6 @@ bool UDPTransportInterface::DoInputLocatorsMatch(
bool UDPTransportInterface::init(
const fastrtps::rtps::PropertyPolicy*)
{
<<<<<<< HEAD
if (configuration()->sendBufferSize == 0 || configuration()->receiveBufferSize == 0)
{
// Check system buffer sizes.
ip::udp::socket socket(io_service_);
socket.open(generate_protocol());

if (configuration()->sendBufferSize == 0)
{
socket_base::send_buffer_size option;
socket.get_option(option);
set_send_buffer_size(static_cast<uint32_t>(option.value()));

if (configuration()->sendBufferSize < s_minimumSocketBuffer)
{
set_send_buffer_size(s_minimumSocketBuffer);
mSendBufferSize = s_minimumSocketBuffer;
}
}

if (configuration()->receiveBufferSize == 0)
{
socket_base::receive_buffer_size option;
socket.get_option(option);
set_receive_buffer_size(static_cast<uint32_t>(option.value()));

if (configuration()->receiveBufferSize < s_minimumSocketBuffer)
{
set_receive_buffer_size(s_minimumSocketBuffer);
mReceiveBufferSize = s_minimumSocketBuffer;
}
}
}

if (configuration()->maxMessageSize > s_maximumMessageSize)
{
EPROSIMA_LOG_ERROR(RTPS_MSG_OUT, "maxMessageSize cannot be greater than 65000");
=======
uint32_t maximumMessageSize = max_msg_size_no_frag == 0 ? s_maximumMessageSize : max_msg_size_no_frag;
uint32_t cfg_max_msg_size = configuration()->maxMessageSize;
uint32_t cfg_send_size = configuration()->sendBufferSize;
Expand All @@ -169,7 +131,6 @@ bool UDPTransportInterface::init(
if (cfg_max_msg_size > maximumMessageSize)
{
EPROSIMA_LOG_ERROR(TRANSPORT_UDP, "maxMessageSize cannot be greater than " << maximumMessageSize);
>>>>>>> 53cd211a8 (Handle errors when setting socket buffer sizes (#4760) (#4796))
return false;
}

Expand All @@ -185,12 +146,6 @@ bool UDPTransportInterface::init(
return false;
}

<<<<<<< HEAD
// TODO(Ricardo) Create an event that update this list.
get_ips(currentInterfaces);

return true;
=======
if ((cfg_send_size > 0) && (cfg_max_msg_size > cfg_send_size))
{
EPROSIMA_LOG_ERROR(TRANSPORT_UDP, "maxMessageSize cannot be greater than sendBufferSize");
Expand All @@ -203,6 +158,9 @@ bool UDPTransportInterface::init(
return false;
}

// TODO(Ricardo) Create an event that update this list.
get_ips(currentInterfaces);

asio::error_code ec;
ip::udp::socket socket(io_service_);
socket.open(generate_protocol(), ec);
Expand Down Expand Up @@ -236,7 +194,6 @@ bool UDPTransportInterface::init(
}

return ret;
>>>>>>> 53cd211a8 (Handle errors when setting socket buffer sizes (#4760) (#4796))
}

bool UDPTransportInterface::IsInputChannelOpen(
Expand Down
6 changes: 0 additions & 6 deletions src/cpp/rtps/transport/UDPv4Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,8 @@
#include <fastrtps/utils/IPLocator.h>

#include <rtps/network/ReceiverResource.h>
<<<<<<< HEAD
=======
#include <rtps/network/utils/netmask_filter.hpp>
#include <rtps/transport/asio_helpers.hpp>

#include <utils/SystemInfo.hpp>
>>>>>>> 53cd211a8 (Handle errors when setting socket buffer sizes (#4760) (#4796))

using namespace std;
using namespace asio;

Expand Down
5 changes: 0 additions & 5 deletions src/cpp/rtps/transport/UDPv6Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@
#include <fastdds/rtps/transport/SenderResource.h>
#include <fastdds/rtps/transport/TransportInterface.h>
#include <fastrtps/utils/IPLocator.h>
<<<<<<< HEAD
=======

#include <rtps/network/utils/netmask_filter.hpp>
#include <rtps/transport/asio_helpers.hpp>
#include <utils/SystemInfo.hpp>
>>>>>>> 53cd211a8 (Handle errors when setting socket buffer sizes (#4760) (#4796))

using namespace std;
using namespace asio;
Expand Down
21 changes: 0 additions & 21 deletions test/blackbox/common/DDSBlackboxTestsListeners.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,25 +674,10 @@ TEST_P(DDSStatus, DataAvailableConditions)
subscriber_reader.wait_waitset_timeout();
}

<<<<<<< HEAD
=======
// We want to ensure that samples are only lost due to the custom filter we have set in sample_lost_test_dw_init.
// Since we are going to send 300KB samples in the test for fragments, let's increase the buffer size to avoid any
// other possible loss.
static constexpr uint32_t SAMPLE_LOST_TEST_BUFFER_SIZE =
300ul * 1024ul // sample size
* 13ul // number of samples
* 2ul; // 2x to avoid any possible loss

template<typename T>
>>>>>>> 53cd211a8 (Handle errors when setting socket buffer sizes (#4760) (#4796))
void sample_lost_test_dw_init(
PubSubWriter<HelloWorldPubSubType>& writer)
{
auto testTransport = std::make_shared<test_UDPv4TransportDescriptor>();
testTransport->sendBufferSize = SAMPLE_LOST_TEST_BUFFER_SIZE;
testTransport->receiveBufferSize = SAMPLE_LOST_TEST_BUFFER_SIZE;

testTransport->drop_data_messages_filter_ = [](eprosima::fastrtps::rtps::CDRMessage_t& msg)-> bool
{
uint32_t old_pos = msg.pos;
Expand Down Expand Up @@ -751,12 +736,6 @@ void sample_lost_test_init(
PubSubWriter<HelloWorldPubSubType>& writer,
std::function<void(const eprosima::fastdds::dds::SampleLostStatus& status)> functor)
{
<<<<<<< HEAD
=======
reader.socket_buffer_size(SAMPLE_LOST_TEST_BUFFER_SIZE);
writer.socket_buffer_size(SAMPLE_LOST_TEST_BUFFER_SIZE);

>>>>>>> 53cd211a8 (Handle errors when setting socket buffer sizes (#4760) (#4796))
sample_lost_test_dw_init(writer);
sample_lost_test_dr_init(reader, functor);

Expand Down

0 comments on commit f7a3d2c

Please sign in to comment.