From 9bb4e106dc023bc5a4aba663723930375bceba9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20P=C3=A9rez?= <78275223+jepemi@users.noreply.github.com> Date: Wed, 28 Feb 2024 21:33:40 +0100 Subject: [PATCH] TCP non_blocking_send moved to TCPTransportDescriptor (#678) * Refs #20502: non_blocking_send moved to tcp transport descriptor Signed-off-by: Jesus Perez * Refs #20502: Apply suggestions Signed-off-by: Jesus Perez --------- Signed-off-by: Jesus Perez --- code/DDSCodeTester.cpp | 11 ----- code/XMLTester.xml | 15 ------- docs/03-exports/aliases-api.include | 1 + .../non_consolidated_qos.rst | 44 ------------------- docs/fastdds/transport/tcp/tcp.rst | 13 ++++++ docs/fastdds/xml_configuration/transports.rst | 5 ++- 6 files changed, 17 insertions(+), 72 deletions(-) diff --git a/code/DDSCodeTester.cpp b/code/DDSCodeTester.cpp index c37b28245..de82abce5 100644 --- a/code/DDSCodeTester.cpp +++ b/code/DDSCodeTester.cpp @@ -865,17 +865,6 @@ void dds_domain_examples() "unicast"); //!-- } - - { - //DDS-TCP-NON-BLOCKING-SEND - DomainParticipantQos participant_qos; - - // TCP transport will use non-blocking send - participant_qos.properties().properties().emplace_back( - "fastdds.tcp_transport.non_blocking_send", - "true"); - //!-- - } } //DOMAINPARTICIPANTLISTENER-DISCOVERY-CALLBACKS diff --git a/code/XMLTester.xml b/code/XMLTester.xml index 0d4c89fda..6c03e363d 100644 --- a/code/XMLTester.xml +++ b/code/XMLTester.xml @@ -3751,21 +3751,6 @@ <--> -XML-TCP-NON-BLOCKING-SEND<--> - - - - - - fastdds.tcp_transport.non_blocking_send - true - - - - - -<--> - XML_TYPELOOKUP_SERVICE_ENABLING<--> diff --git a/docs/03-exports/aliases-api.include b/docs/03-exports/aliases-api.include index e56463b43..ef42b1460 100644 --- a/docs/03-exports/aliases-api.include +++ b/docs/03-exports/aliases-api.include @@ -625,6 +625,7 @@ .. |TCPTransportDescriptor::logical_port_range-api| replace:: :cpp:var:`logical_port_range` .. |TCPTransportDescriptor::logical_port_increment-api| replace:: :cpp:var:`logical_port_increment` .. |TCPTransportDescriptor::enable_tcp_nodelay-api| replace:: :cpp:var:`enable_tcp_nodelay` +.. |TCPTransportDescriptor::non_blocking_send-api| replace:: :cpp:var:`non_blocking_send` .. |TCPTransportDescriptor::calculate_crc-api| replace:: :cpp:var:`calculate_crc` .. |TCPTransportDescriptor::check_crc-api| replace:: :cpp:var:`check_crc` .. |TCPTransportDescriptor::apply_security-api| replace:: :cpp:var:`apply_security` diff --git a/docs/fastdds/property_policies/non_consolidated_qos.rst b/docs/fastdds/property_policies/non_consolidated_qos.rst index 9858014d1..7b0e14656 100644 --- a/docs/fastdds/property_policies/non_consolidated_qos.rst +++ b/docs/fastdds/property_policies/non_consolidated_qos.rst @@ -351,47 +351,3 @@ The behavior regarding this can be configured using the property ``fastdds.shm.e :language: xml :start-after: XML-SHM-ENFORCE-META-TRAFFIC :end-before: <--> - -.. _property_policies_tcp_non_blocking_send: - -TCP Non-blocking send -^^^^^^^^^^^^^^^^^^^^^ - -TCP transport will by default configure a :ref:`transport_tcp_tcp` with blocking send calls. -When ``fastdds.tcp_transport.non_blocking_send`` property is set to ``true``, send operations will -return immediately if the send buffer is full, but no error will be returned to the upper layer. -This means that the application will behave as if the packet is sent and lost. - -When set to ``false``, send operations will block until the network buffer has space for the -packet. - -.. list-table:: - :header-rows: 1 - :align: left - - * - PropertyPolicyQos value - - Description - - Default - * - ``"false"`` - - Block on send operations when send buffer is full. - - ✅ - * - ``"true"`` - - Do not block on send operations when send buffer is full. - - - -.. tabs:: - - .. tab:: C++ - - .. literalinclude:: /../code/DDSCodeTester.cpp - :language: c++ - :start-after: //DDS-TCP-NON-BLOCKING-SEND - :end-before: //!-- - :dedent: 8 - - .. tab:: XML - - .. literalinclude:: /../code/XMLTester.xml - :language: xml - :start-after: XML-TCP-NON-BLOCKING-SEND - :end-before: <--> diff --git a/docs/fastdds/transport/tcp/tcp.rst b/docs/fastdds/transport/tcp/tcp.rst index 32477f1a4..a033766fd 100644 --- a/docs/fastdds/transport/tcp/tcp.rst +++ b/docs/fastdds/transport/tcp/tcp.rst @@ -96,6 +96,10 @@ The following table describes the common data members for both TCPv4 and TCPv6. - ``bool`` - ``false`` - Enables the TCP_NODELAY socket option. + * - |TCPTransportDescriptor::non_blocking_send-api| + - ``bool`` + - ``false`` + - Do not block on send operations (*). * - |TCPTransportDescriptor::calculate_crc-api| - ``bool`` - ``true`` @@ -134,6 +138,15 @@ The following table describes the common data members for both TCPv4 and TCPv6. If |TCPTransportDescriptor::listening_ports-api| is left empty, the participant will not be able to receive incoming connections but will be able to connect to other participants that have configured their listening ports. +.. note:: + + When |TCPTransportDescriptor::non_blocking_send-api| is set to ``true``, send operations will return immediately if the + send buffer might get full, but no error will be returned to the upper layer. + This means that the application will behave as if the packet is sent and lost. + + When set to ``false``, send operations will block until the network buffer has space for the + packet. + .. _transport_tcp_v4transportDescriptor: TCPv4TransportDescriptor diff --git a/docs/fastdds/xml_configuration/transports.rst b/docs/fastdds/xml_configuration/transports.rst index 083e1043a..be3e39010 100644 --- a/docs/fastdds/xml_configuration/transports.rst +++ b/docs/fastdds/xml_configuration/transports.rst @@ -59,8 +59,9 @@ A more detailed explanation of each of these elements can be found in :ref:`comm | | :ref:`transport_udp_udp`. | | | +-------------------------------+----------------------------------------------------+----------------------+----------+ | ```` | Whether to set the non-blocking send mode on |br| | ``bool`` | ``false``| -| | the socket (**UDP only**). See |br| | | | -| | :ref:`transport_udp_transportDescriptor`. | | | +| | the socket (**NOT available for SHM type**). See | | | +| | |br| :ref:`transport_udp_transportDescriptor` and | | | +| | |br| :ref:`transport_tcp_transportDescriptor`. | | | +-------------------------------+----------------------------------------------------+----------------------+----------+ | ```` | Port used for output bound. |br| | ``uint16_t`` | 0 | | | If this field isn't defined, the output port |br| | | |