目录

About This Kit

Basic Concepts

Abbreviation Full Name Description Meaning
IPC Inter Process Communication Inter-process communication Inter-process communication within a device.
RPC Remote Procedure Call Remote procedure call Inter-process communication across devices.
Client Client Client A proxy that requests services.
Server Server Server A stub that provides services.
  • Before using IPC and RPC for inter-process communication, you need to call the ability API for service connection to obtain the proxy object. IPC and RPC are typically used in the following scenarios:

  • IPC is typically used in background services, which use the IPC mechanism to provide the capability of cross-process API calling and data transfer on a single device.

  • RPC is used in multi-device collaboration to implement remote API calls and data transfer cross devices.

Working Principles

Both IPC and RPC implement cross-process communication. IPC uses the Binder driver to implement cross-process communication in a device, while RPC uses the DSoftBus driver to implement cross-process communication across devices. Each process has its own resources and independent memory space, and one process is not allowed to access the resources and memory space of other processes. That is why cross-process communication is required.

IPC and RPC use the client-server model. In this model, the client process obtains the proxy of the server process, reads and writes data and initiates requests through the proxy, while the stub processes the requests and returns results, thereby implementing cross-process communication.

Constraints

Emulator Support

This kit is supported on the Emulator.

There are some general differences between the Emulator and real devices. For details, please refer to Differences Between the Emulator and the Real Device.