Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[20180] TCP Client&Server Participant Decision-Making #4277

Merged
merged 45 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
913b444
Refs #20180: Spelling fix
cferreiragonz Jan 12, 2024
df1aa04
Refs #20180: Create function to check pending_logical_ports
cferreiragonz Jan 19, 2024
794537d
Refs #20180: Add new TCP Connection type
cferreiragonz Jan 22, 2024
c0de093
Refs #20180: Add new method to enable TCP channel after connection in…
cferreiragonz Jan 22, 2024
69ebf24
Refs #20180: Refactor OpenOutputChannel method
cferreiragonz Jan 22, 2024
10ee0ba
Refs #20180: Include LARGE DATA logic in SocketAccepted method
cferreiragonz Jan 22, 2024
fb6513c
Refs #20180: Include LARGE DATA logic in processBindConnectionRequest…
cferreiragonz Jan 22, 2024
d3ebda2
Refs #20180: Add new TCP connection and methods SECURITY
cferreiragonz Jan 22, 2024
9d4946f
Refs #20180: Add SECURITY support to OpenOutputChannel
cferreiragonz Jan 22, 2024
c25c0c8
Refs #20180: Include LARGE DATA logic in SecureSocketAccepted method
cferreiragonz Jan 22, 2024
ef04310
Refs #20180: Bugfix setting environment variable in tests
cferreiragonz Jan 23, 2024
234a4c1
Refs #20180: Add multicast IPv6 to LARGE_DATA locator
cferreiragonz Jan 23, 2024
ef76564
Refs #20180: Add TCP test in LARGE_DATA Topology
cferreiragonz Jan 23, 2024
ef6d648
Refs #20180: Clean code & Uncrustify
cferreiragonz Jan 22, 2024
9024ce9
Refs #20180: Modified participant populated test
jepemi Feb 6, 2024
102efdf
Refs #20180: Add new api to update channels
cferreiragonz Feb 6, 2024
1af4c93
Refs #20180: Refactor OpenOutputChannel with new channel map
cferreiragonz Feb 6, 2024
dd3773d
Refs #20180: Refactor bind_socket with new channel map
cferreiragonz Feb 6, 2024
a83c963
Refs #20180: Refactor SocketAccepted with new channel map (Revert to …
cferreiragonz Feb 6, 2024
db63775
Refs #20180: Refactor CloseOutputChannel to support cases with new ch…
cferreiragonz Feb 6, 2024
7717c3c
Refs #20180: Update Secure channel logic with new channel map
cferreiragonz Feb 6, 2024
994e840
Refs #20180: Use same IPv6 as defaultMetatrafficMulticast
cferreiragonz Feb 7, 2024
e3de336
Refs #20180: Refactor using locator inside sender resource instead of…
cferreiragonz Feb 9, 2024
7615d52
Refs #20180: Data races associated
cferreiragonz Feb 9, 2024
6d5853a
Refs #20180: Apply suggestions to tests
jepemi Feb 9, 2024
b9c0fa0
Refs #20180: Add OpenLogicalPortRequest scenario before Bind Response…
cferreiragonz Feb 9, 2024
9cd9781
Refs #20180. Remove unnecessary methods.
MiguelCompany Feb 9, 2024
168cd9c
Refs #20180. Early exit when logical_port is 0.
MiguelCompany Feb 9, 2024
61edc07
Refs #20180. Refactor to avoid lambda.
MiguelCompany Feb 9, 2024
c10b34d
Refs #20180. Minor changes.
MiguelCompany Feb 9, 2024
80d908a
Refs #20180. Simplify with WanToLanLocator.
MiguelCompany Feb 9, 2024
9255f99
Refs #20180: Apply suggestions
cferreiragonz Feb 12, 2024
ab9637a
Revert "Refs #20180: Add new TCP Connection type"
cferreiragonz Feb 12, 2024
7dbacca
Refs #20180: Remove unnecessary lock
cferreiragonz Feb 12, 2024
9070733
Revert "Refs #20180: Add new TCP connection and methods SECURITY"
cferreiragonz Feb 12, 2024
a467888
Refs #20180: Fix test (file descriptors limit)
jepemi Feb 12, 2024
84104ed
Refs #20180: Uncrustify
jepemi Feb 12, 2024
2853b2d
Refs #20180. Fix port comparison.
MiguelCompany Feb 12, 2024
8f2d01a
Refs #20180: Fix double lock and update old test with current behavior
jepemi Feb 12, 2024
242051d
Refs #20180: Apply suggestions
jepemi Feb 12, 2024
a4090bd
Refs #20180: Fix windows test build
jepemi Feb 12, 2024
e2d6fe3
Refs #20180: Apply test suggestions
jepemi Feb 13, 2024
2bae02a
Refs #20180: Bugfix with cv in receiver_resources_ destruction
cferreiragonz Feb 13, 2024
51c099f
Refs #20180. Delete participant on failing ParticipantTests.Participa…
MiguelCompany Feb 14, 2024
a4e6e3f
Refs #20180. Do not use non_blocking_send on TCP transport for LARGE_…
MiguelCompany Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/cpp/fastdds/publisher/DataWriterImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,7 @@ const DataWriterQos& DataWriterImpl::get_qos() const
ReturnCode_t DataWriterImpl::set_listener(
DataWriterListener* listener)
{
std::lock_guard<std::mutex> scoped_lock(listener_mutex_);
listener_ = listener;
return ReturnCode_t::RETCODE_OK;
}
Expand Down Expand Up @@ -1974,6 +1975,7 @@ bool DataWriterImpl::can_qos_be_updated(
DataWriterListener* DataWriterImpl::get_listener_for(
const StatusMask& status)
{
std::lock_guard<std::mutex> scoped_lock(listener_mutex_);
if (listener_ != nullptr &&
user_datawriter_->get_status_mask().is_active(status))
{
Expand Down
3 changes: 3 additions & 0 deletions src/cpp/fastdds/publisher/DataWriterImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,9 @@ class DataWriterImpl : protected rtps::IReaderDataFilter
//! DataWriterListener
DataWriterListener* listener_ = nullptr;

//! Mutex to protect listener_
std::mutex listener_mutex_;

//!History
DataWriterHistory history_;

Expand Down
3 changes: 1 addition & 2 deletions src/cpp/rtps/attributes/RTPSParticipantAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ static void setup_transports_large_data(

auto tcp_transport = create_tcpv4_transport(att);
att.userTransports.push_back(tcp_transport);
att.properties.properties().emplace_back("fastdds.tcp_transport.non_blocking_send", "true");

Locator_t tcp_loc;
tcp_loc.kind = LOCATOR_KIND_TCPv4;
Expand Down Expand Up @@ -245,7 +244,6 @@ static void setup_transports_large_datav6(

auto tcp_transport = create_tcpv6_transport(att);
att.userTransports.push_back(tcp_transport);
att.properties.properties().emplace_back("fastdds.tcp_transport.non_blocking_send", "true");

Locator_t tcp_loc;
tcp_loc.kind = LOCATOR_KIND_TCPv6;
Expand All @@ -263,6 +261,7 @@ static void setup_transports_large_datav6(
{
Locator_t pdp_locator;
pdp_locator.kind = LOCATOR_KIND_UDPv6;
IPLocator::setIPv6(pdp_locator, "ff1e::ffff:efff:1");
att.builtin.metatrafficMulticastLocatorList.push_back(pdp_locator);
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/cpp/rtps/transport/TCPChannelResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ ResponseCode TCPChannelResource::process_bind_request(
if (connection_status_.compare_exchange_strong(expected, eConnectionStatus::eEstablished))
{
locator_ = IPLocator::toPhysicalLocator(locator);
EPROSIMA_LOG_INFO(RTCP_MSG, "Connection Stablished");
EPROSIMA_LOG_INFO(RTCP_MSG, "Connection Established");
return RETCODE_OK;
}
else if (expected == eConnectionStatus::eEstablished)
Expand Down Expand Up @@ -139,9 +139,7 @@ void TCPChannelResource::add_logical_port(
pending_logical_output_ports_.emplace_back(port);
if (connection_established())
{
scopedLock.unlock();
TCPTransactionId id = rtcp_manager->sendOpenLogicalPortRequest(this, port);
scopedLock.lock();
negotiating_logical_ports_[id] = port;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/cpp/rtps/transport/TCPChannelResourceBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ void TCPChannelResourceBasic::disconnect()
{
if (eConnecting < change_status(eConnectionStatus::eDisconnected) && alive())
{
std::lock_guard<std::mutex> read_lock(read_mutex_);
auto socket = socket_;

std::error_code ec;
Expand Down
14 changes: 7 additions & 7 deletions src/cpp/rtps/transport/TCPSenderResource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ class TCPSenderResource : public fastrtps::rtps::SenderResource

TCPSenderResource(
TCPTransportInterface& transport,
std::shared_ptr<TCPChannelResource>& channel)
eprosima::fastrtps::rtps::Locator_t& locator)
: fastrtps::rtps::SenderResource(transport.kind())
, channel_(channel)
, locator_(locator)
{
// Implementation functions are bound to the right transport parameters
clean_up = [this, &transport]()
{
transport.CloseOutputChannel(channel_);
transport.CloseOutputChannel(locator_);
};

send_lambda_ = [this, &transport](
Expand All @@ -49,7 +49,7 @@ class TCPSenderResource : public fastrtps::rtps::SenderResource
fastrtps::rtps::LocatorsIterator* destination_locators_end,
const std::chrono::steady_clock::time_point&) -> bool
{
return transport.send(data, dataSize, channel_, destination_locators_begin,
return transport.send(data, dataSize, locator_, destination_locators_begin,
destination_locators_end);
};
}
Expand All @@ -62,9 +62,9 @@ class TCPSenderResource : public fastrtps::rtps::SenderResource
}
}

std::shared_ptr<TCPChannelResource>& channel()
fastrtps::rtps::Locator_t& locator()
{
return channel_;
return locator_;
}

static TCPSenderResource* cast(
Expand Down Expand Up @@ -102,7 +102,7 @@ class TCPSenderResource : public fastrtps::rtps::SenderResource
TCPSenderResource& operator =(
const SenderResource&) = delete;

std::shared_ptr<TCPChannelResource> channel_;
fastrtps::rtps::Locator_t locator_;
};

} // namespace rtps
Expand Down
Loading
Loading