Part 9: Remote Procedure Calls (RPC)

Remote Procedure Calls, or RPC, is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space.

Note: The RPC feature is available for the Modern C++ and Python APIs on certain platforms. See the RTI Connext Core Libraries Platform Notes for the supported platforms.

RPC has two participants: a client and a service. Under the hood, the client uses a Requester to send requests and receive replies; the service uses a Replier to receive the requests and send the replies.

The Requester and Replier used by RPC will work with the enhanced discovery protocol explained in 47.3 Request-Reply Endpoint Discovery.

RPC over DDS uses a function-call style where the client/Requester directly calls the service/Replier by calling the service's functions. This mechanism abstracts the process of sending the request and receiving the corresponding reply on the client side. Before calling any service/Replier, the client/Requester must wait until a service is discovered because the enhanced discovery protocol.

RPC Overview

Connext supports both blocking and non-blocking interactions:

  • In a blocking (or synchronous) interaction, the client application blocks while waiting for the service’s answer.
  • In a non-blocking (or asynchronous) interaction, the client application can proceed with other work, ask if the service’s answer is already available, or wait for the service’s answer.

It is possible for a client to call more than one function at a time, particularly when asynchronous invocations are used.

Chapter 50 RPC Client explains how a client application can use the method provided by the interface to perform both blocking and non-blocking interactions with the service.

Standard Compliance: By default, the Connext Request-Reply and RPC communication patterns are not fully compliant with the OMG DDS RPC specification. With Connext 7.4.0 and higher, you can configure Connext to be compliant. For more information, see Chapter 53 Standard Compliance.

Additional resources: You can find more information and example code here:

  • The Connext API Reference HTML documentation contains example code that will show you how to use the API: From the Modules tab, navigate to Programming How-To’s, RPC Tutorial.
  • The Connext API Reference HTML documentation also contains the full API documentation for the client-side and server-side APIs. Under the Modules tab, navigate to RTI Connext API Reference, Additional RTI Connext Communication Patterns, Remote Procedure Call.
  • The RTI Community GitHub repository contains C++ and Python example code to create a simple inventory service.