IPC server/client

I have created two applications and each has a component. At the moment I use one application as a server and the other as a client.

I might need communication in both directions so I have tried to create an application that is both a client and server. Meaning that the cdef file has both provides and requires section. Adef file has both bindings and provides section. But this fails for me. The application does not start properly, I don’t even get to the COMPONENT_INIT.

Is it supposed to be possible to do this or is there a better way to send data in both directions?

Just realised that it is possible to return a value from the server back to the client. At least that will be enough for me. You have to define in the *.api file that something should be reurned. If you don’t specify anything it is void.

FUNCTION SetCommand
(
    string message[100] IN 
);
FUNCTION int SetTemp
(
    double message IN 
);

Hiya,

I managed to get a multi threaded application running that used shared memory to communicate between threads.

However, this was using the posix shm interface, not via the Legato api.

Ciao, Dave

You can also specify that a parameter is an OUT parameter to get info back from the server. For example:

FUNCTION int SetTemp
(
    double message IN, 
    double result OUT
);

…And you can use also create call-backs from the server to the client (although, to prevent deadlocks, those can’t return anything to the server).