IPC

Inter-Process Communication

IPC consists of 4 parts, the Service, the Interface, the Endpoint, the Message.

Service

This is created by a singular process. This is a non editable handle where it cannot be re-opened within another process. This holds interfaces.

Interface

A sub-module to the service. This holds and creates endpoints for interactions between process.

Processes can request connections to these interfaces using a path including a service. The host processes needs to accept a pending connection and create a endpoint for interactions.

Endpoint

Opened within a Interface. The host of the interface needs to accept a connection first before these can be created. They are used for sending and receiving data between the service process and the client process. The service process will be constant, whereas the client can change and be any process.

Messages can be sent to and from these Endpoints. They can be polled to see if there is any incoming messages in their queue, prioritising messages that expect a response.

Message

There are 3 requirements to a message. There is the ID which describes the purpose of the message, the size which is a data size of the buffer (Cannot be larger than the interface max size which is typically 512 Bytes). Then there is the data buffer address which is where the message data is kept.

There is a message encoder which allows the conversion of structs into a simple data buffer. You could use casts, however if the cast contains something like a const char* we want to copy the string contents not the address as the recipient wont have access to the address!

Last updated