From 36f7f57b039d9f762c9d04797c5ee5b34ac0ca1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20P=C3=A9rez?= <78275223+jepemi@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:36:34 +0100 Subject: [PATCH] Fix wrong log info messages on TCP (#4258) Signed-off-by: Jesus Perez --- src/cpp/rtps/transport/TCPTransportInterface.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/cpp/rtps/transport/TCPTransportInterface.cpp b/src/cpp/rtps/transport/TCPTransportInterface.cpp index b8ebdfe4bc9..a4ec817b070 100644 --- a/src/cpp/rtps/transport/TCPTransportInterface.cpp +++ b/src/cpp/rtps/transport/TCPTransportInterface.cpp @@ -871,6 +871,7 @@ void TCPTransportInterface::perform_listen_operation( if (rtcp_message_manager) { channel = channel_weak.lock(); + endpoint_to_locator(channel->remote_endpoint(), remote_locator); if (channel) { @@ -1360,7 +1361,8 @@ void TCPTransportInterface::SocketAccepted( create_listening_thread(channel); EPROSIMA_LOG_INFO(RTCP, "Accepted connection (local: " - << IPLocator::to_string(locator) << ", remote: " + << channel->local_endpoint().address() << ":" + << channel->local_endpoint().port() << "), remote: " << channel->remote_endpoint().address() << ":" << channel->remote_endpoint().port() << ")"); } @@ -1403,10 +1405,11 @@ void TCPTransportInterface::SecureSocketAccepted( secure_channel->set_options(configuration()); create_listening_thread(secure_channel); - EPROSIMA_LOG_INFO(RTCP, " Accepted connection (local: " << IPLocator::to_string(locator) - << ", remote: " << socket->lowest_layer().remote_endpoint().address() - << ":" << socket->lowest_layer().remote_endpoint().port() << - ")"); + EPROSIMA_LOG_INFO(RTCP, " Accepted connection (local: " + << socket->lowest_layer().local_endpoint().address() << ":" + << socket->lowest_layer().local_endpoint().port() << "), remote: " + << socket->lowest_layer().remote_endpoint().address() << ":" + << socket->lowest_layer().remote_endpoint().port() << ")"); } else {