Description files in the ping example

Description of the Client entity

The Client entity does not implement an interface, so all you need to do is declare the entity name in the EDL description.

Client.edl

/* Client entity description. */

entity Client

Server entity description

The Server entity implements a Ping interface, which contains two methods: Ping and Pong. As in the echo example, you must declare a separate component, such as Ping, which contains a Ping interface implementation.

In the EDL description of the server entity, you must indicate that it contains an instance of the Ping component:

Server.edl

/* Server entity description. */

entity Server

/* pingComp is a named instance of the Ping component. */

components {

pingComp: Ping

}

In the CDL description of the Ping component, you must indicate that it contains a Ping interface implementation:

Ping.cdl

/* Ping component description. */

component Ping

* pingImpl is the Ping interface implementation. */

interfaces {

pingImpl: Ping

}

In the Ping package, you must declare the Ping interface, which contains two methods: Ping and Pong:

Ping.idl

/* Ping package description. */

package Ping

interface {

Ping(in UInt32 value, out UInt32 result);

Pong(in UInt32 value, out UInt32 result);

}

Init description

To enable the Client entity to call a Server entity method, an IPC channel must be created between them.

init.yaml

entities:

- name: Client

connections:

- target: Server

id: server_connection

- name: Server

The channel is named server_connection. You can obtain the handle of this channel by using the Service Locator.

Page top