diff --git a/code/DDSCodeTester.cpp b/code/DDSCodeTester.cpp index 3555e409e..6f3846e90 100644 --- a/code/DDSCodeTester.cpp +++ b/code/DDSCodeTester.cpp @@ -5997,7 +5997,7 @@ void tcp_use_cases() // TCPv4 transport for EDP and application data (The listening port must to be unique for // each participant in the same host) - constexpr uint16_t tcp_listening_port = 12345; + constexpr uint16_t tcp_listening_port = 0; auto data_transport = std::make_shared(); data_transport->add_listener_port(tcp_listening_port); pqos.transport().user_transports.push_back(data_transport); diff --git a/code/XMLTester.xml b/code/XMLTester.xml index 1ee93c7cb..68356c337 100644 --- a/code/XMLTester.xml +++ b/code/XMLTester.xml @@ -3676,7 +3676,7 @@ This needs to be unique for each participant in the host --> - 12345 + 0 diff --git a/docs/fastdds/transport/tcp/tcp.rst b/docs/fastdds/transport/tcp/tcp.rst index 5eec238ef..97e9b60ad 100644 --- a/docs/fastdds/transport/tcp/tcp.rst +++ b/docs/fastdds/transport/tcp/tcp.rst @@ -71,7 +71,7 @@ The following table describes the common data members for both TCPv4 and TCPv6. * - |TCPTransportDescriptor::listening_ports-api| - ``vector`` - Empty vector - - List of ports to listen as *server*. + - List of ports to listen as *server*. If a port is set to 0, an available port will be automatically assigned. * - |TCPTransportDescriptor::keep_alive_frequency_ms-api| - ``uint32_t`` - 5000 diff --git a/docs/fastdds/xml_configuration/transports.rst b/docs/fastdds/xml_configuration/transports.rst index 8a0ed9982..083e1043a 100644 --- a/docs/fastdds/xml_configuration/transports.rst +++ b/docs/fastdds/xml_configuration/transports.rst @@ -94,7 +94,9 @@ A more detailed explanation of each of these elements can be found in :ref:`comm +-------------------------------+----------------------------------------------------+----------------------+----------+ | ```` | Local port to work as TCP acceptor for input |br| | ``List `` | | | | connections. If not set, the transport will |br| | | | -| | work as TCP client only (**TCP only**). | | | +| | work as TCP client only. If set to 0, an |br| | | | +| | available port will be automatically assigned |br| | | | +| | (**TCP only**). | | | +-------------------------------+----------------------------------------------------+----------------------+----------+ | ```` | Allows to define TLS related parameters and |br| | :ref:`tcp-tls` | | | | options (**TCP only**). | | |