Inter-transport communication becomes necessary, when participants want to communicate that are connected to the unified bus using different transport mechanisms.
This page describes how to setup participants for inter-transport communication using the following scenario which is illustrated in the above figure:
Participants reside in two separate processes
Note
With this setup, the listener in the inprocess-and-socket process will currently receive all events twice.
There are two ways to attach multiple transports to participants:
These two alternatives are described below.
When configured via the configuration mechanism, the multi-transport setup will have a global effect in the following sense: it will affect all participants in all processes which are not explicitly instantiated with a different set of connectors.
In addition to the Spread transport which is (currently) enabled by default, other transports can be enabled globally using a configuration file fragment like this:
[transport.inprocess]
enabled = 1
The set of transports used by individual participants or as a default by all newly created participants can be configured by modifying rsb::ParticipantConfig::Transport objects. These objects contain, among other things, an option which controls whether a particular transport is enabled. A modified rsb::ParticipantConfig object can be used in two ways:
Globally for a Process
The example programs inprocess-and-socket.cpp and socket-only.cpp implement the inter-transport setup described above by modifying the default participant configuration in the inprocess-and-socket process to include the inprocess transport.
Locally for a Participant
In order to use a prepared rsb::ParticipantConfig object only locally instead of installing it as a global default, it can be passed to the following methods:
- rsb::Factory::createReader
- rsb::Factory::createListener
- rsb::Factory::createInformer
Note
In each of these cases, the modified configuration options will only effect the participant created by the method call.