Client stops when server provider stops

I have a server app which provides some interface.
A client bind to the api and uses it.

So far so good.

They can be started in any order.

However when server stops then client is killed too. Notice that this happen even when client is not using the API.

Is there any way to prevent client from stopping when server dies?

@m.opoka, can you please provide more details, I don’t understand your usecase.

Thank you
BR

@mehdiALL1
I have a one app providing an interface (server) for getting some configuration details. Another app (client) connects to it to get this data. Both are separated to allow restarting them separately.

But when server is stopped it the client is shutdown as well. I would like it to keep running.

BR,

Hi @m.opoka, could you have a look at API detect unexpected client disconnection - #4 by oabid ?

The idea is that you can use a api_SetServerDisconnectHandler to be notified when a server is being disconnected.

You can also use [manual-start] to make your application connect & disconnect from a service manually, and eventually handle the reconnection using TryConnect

I realize that we don’t have that much doc on these API client functions (it should be here: C Language Support - Legato Docs , but it’s not), so I created a ticket for us to do so.

1 Like