Skip to content

Commit

Permalink
Fix wrong log info messages on TCP (#4258) (#4312)
Browse files Browse the repository at this point in the history
* Fix wrong log info messages on TCP (#4258)

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
(cherry picked from commit 36f7f57)

# Conflicts:
#	src/cpp/rtps/transport/TCPTransportInterface.cpp

* Refs #20262: Resolve conflicts

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>

---------

Signed-off-by: Jesus Perez <jesusperez@eprosima.com>
Co-authored-by: Jesús Pérez <78275223+jepemi@users.noreply.github.com>
Co-authored-by: Jesus Perez <jesusperez@eprosima.com>
  • Loading branch information
3 people authored Feb 14, 2024
1 parent b3c6e4e commit 5225888
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/cpp/rtps/transport/TCPTransportInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ void TCPTransportInterface::perform_listen_operation(
if (rtcp_message_manager)
{
channel = channel_weak.lock();
endpoint_to_locator(channel->remote_endpoint(), remote_locator);

if (channel)
{
Expand Down Expand Up @@ -1316,9 +1317,11 @@ void TCPTransportInterface::SocketAccepted(
channel->thread(std::thread(&TCPTransportInterface::perform_listen_operation, this,
channel_weak_ptr, rtcp_manager_weak_ptr));

EPROSIMA_LOG_INFO(RTCP, " Accepted connection (local: " << IPLocator::to_string(locator)
<< ", remote: " << channel->remote_endpoint().address()
<< ":" << channel->remote_endpoint().port() << ")");
EPROSIMA_LOG_INFO(RTCP, "Accepted connection (local: "
<< channel->local_endpoint().address() << ":"
<< channel->local_endpoint().port() << "), remote: "
<< channel->remote_endpoint().address() << ":"
<< channel->remote_endpoint().port() << ")");
}
else
{
Expand Down Expand Up @@ -1362,10 +1365,11 @@ void TCPTransportInterface::SecureSocketAccepted(
secure_channel->thread(std::thread(&TCPTransportInterface::perform_listen_operation, this,
channel_weak_ptr, rtcp_manager_weak_ptr));

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
{
Expand Down

0 comments on commit 5225888

Please sign in to comment.