KasperskyOS Community Edition 1.0

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

/* Description of the Client entity. */

entity ping.Client

Server entity description

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

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

Server.edl

/* Description of the Server entity. */

entity ping.Server

/* controlimpl is a named instance of the ping.Control component. */

components {

controlimpl : ping.Control

}

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

Control.cdl

/* Description of the Control component. */

component ping.Control

/* connectionimpl is the ping.Connection interface implementation. */

interfaces {

connectionimpl : ping.Connection

}

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

Connection.idl

/* Description of the Connection package. */

package ping.Connection

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: ping.Client

connections:

- target: ping.Server

id: server_connection

- name: ping.Server

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