Chapter 17 RPC

A Remote Procedure Call (RPC) is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space. An RPC has two participants: a client and a service. The client uses a Requester to send requests and receive replies; the service uses a Replier to receive the requests and send the replies.

RPC over DDS uses a function-call style where the client directly calls the service by calling the service's functions, abstracting sending the request and receiving the corresponding reply on the client side.

A service receives requests from those clients that are subscribed to it, and sends replies to those clients. Each service has an associated Replier; all the entities required by the Replier—including the DomainParticipant, the request and reply Topics, the DataWriter for writing replies, and a DataReader for reading the requests—are automatically created when the service is created.

A client allows making remote function calls to the services that it is subscribed to, and receives the results to those calls from those services. Each client has an associated Requester; all the entities required by the Requester—including the DomainParticipant, the request and reply Topics, the DataWriter for writing the requests, and a DataReader for reading replies—are automatically created when the client is created.

To communicate, a client/Requester and a service/Replier must use the same service name, and be associated with the same DDS domain_id.

For more information, see Part 9: Remote Procedure Calls (RPC).