diff --git a/src/cpp/rtps/transport/TCPTransportInterface.cpp b/src/cpp/rtps/transport/TCPTransportInterface.cpp index afaebb5ee7f..9f07fe17324 100644 --- a/src/cpp/rtps/transport/TCPTransportInterface.cpp +++ b/src/cpp/rtps/transport/TCPTransportInterface.cpp @@ -265,7 +265,7 @@ Locator TCPTransportInterface::remote_endpoint_to_locator( { Locator locator; asio::error_code ec; - auto endpoint = channel->local_endpoint(ec); + auto endpoint = channel->remote_endpoint(ec); if (ec) { LOCATOR_INVALID(locator);