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

Refs #20019: Add TCP listening port behavior when set to 0 (backport #598) #604

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5956,7 +5956,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<eprosima::fastdds::rtps::TCPv4TransportDescriptor>();
data_transport->add_listener_port(tcp_listening_port);
pqos.transport().user_transports.push_back(data_transport);
Expand Down
2 changes: 1 addition & 1 deletion code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3457,7 +3457,7 @@
This needs to be unique for each participant in the host
-->
<listening_ports>
<port>12345</port>
<port>0</port>
</listening_ports>
</transport_descriptor>
</transport_descriptors>
Expand Down
2 changes: 1 addition & 1 deletion docs/fastdds/transport/tcp/tcp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The following table describes the common data members for both TCPv4 and TCPv6.
* - |TCPTransportDescriptor::listening_ports-api|
- ``vector<uint16_t>``
- 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
Expand Down
4 changes: 3 additions & 1 deletion docs/fastdds/xml_configuration/transports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ A more detailed explanation of each of these elements can be found in :ref:`comm
+-------------------------------+----------------------------------------------------+----------------------+----------+
| ``<listening_ports>`` | Local port to work as TCP acceptor for input |br| | ``List <uint16_t>`` | |
| | 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**). | | |
+-------------------------------+----------------------------------------------------+----------------------+----------+
| ``<tls>`` | Allows to define TLS related parameters and |br| | :ref:`tcp-tls` | |
| | options (**TCP only**). | | |
Expand Down