Skip to content

Commit

Permalink
Improve SHM use only documentation (#593)
Browse files Browse the repository at this point in the history
* Refs #19803: Improve SHM use only documentation

Signed-off-by: JesusPoderoso <[email protected]>

* Refs #19803: Apply rev suggestion

Signed-off-by: JesusPoderoso <[email protected]>

---------

Signed-off-by: JesusPoderoso <[email protected]>
  • Loading branch information
JesusPoderoso authored Nov 10, 2023
1 parent 92c5716 commit 43b06f5
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
15 changes: 15 additions & 0 deletions code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4628,6 +4628,21 @@ void dds_transport_examples ()
//!--
}

{
//CONF-SHM-TRANSPORT-DISABLE-BUILTIN-TRANSPORTS
DomainParticipantQos qos;

// Create a descriptor for the new transport.
std::shared_ptr<SharedMemTransportDescriptor> shm_transport = std::make_shared<SharedMemTransportDescriptor>();

// Link the Transport Layer to the Participant.
qos.transport().user_transports.push_back(shm_transport);

// Explicit configuration of SharedMem transport
qos.transport().use_builtin_transports = false;
//!--
}

{
//CONF-TCP-TLS-SERVER
DomainParticipantQos qos;
Expand Down
24 changes: 24 additions & 0 deletions code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,30 @@
</participant>
<!--><-->

<!-->CONF-SHM-TRANSPORT-DISABLE-BUILTIN-TRANSPORTS<-->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
-->
<transport_descriptors>
<!-- Create a descriptor for the new transport -->
<transport_descriptor>
<transport_id>shm_transport_only</transport_id>
<type>SHM</type>
</transport_descriptor>
</transport_descriptors>

<participant profile_name="DisableBuiltinTransportsParticipant">
<rtps>
<!-- Link the Transport Layer to the Participant -->
<userTransports>
<transport_id>shm_transport_only</transport_id>
</userTransports>
<useBuiltinTransports>false</useBuiltinTransports>
</rtps>
</participant>
<!--><-->

<!-->CONF-TCP-TLS-SERVER<-->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
Expand Down
24 changes: 24 additions & 0 deletions docs/fastdds/transport/shared_memory/shared_memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,30 @@ The examples below show this procedure in both C++ code and XML file.
is automatically performed by SHM transport only.
The rest of the enabled transports are not used between those two participants.

.. hint::
To configure discovery traffic through Shared Memory, the default builtin transports must be disabled.
In that way, communication is performed completely using Shared Memory.
The snippet examples below show this procedure in both C++ code and XML file.
See :ref:`transport_sharedMemory_example` for a complete example.

.. tabs::

.. tab:: C++

.. literalinclude:: /../code/DDSCodeTester.cpp
:language: c++
:start-after: //CONF-SHM-TRANSPORT-DISABLE-BUILTIN-TRANSPORTS
:end-before: //!--
:dedent: 8

.. tab:: XML

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->CONF-SHM-TRANSPORT-DISABLE-BUILTIN-TRANSPORTS
:end-before: <!--><-->
:lines: 2-3,5-
:append: </profiles>

.. _transport_sharedMemory_example:

Expand Down

0 comments on commit 43b06f5

Please sign in to comment.