# Client stops when server provider stops

**URL:** <https://forum.legato.io/t/client-stops-when-server-provider-stops/4544>\
**Category:** Legato Application Framework\
**Created:** [July 9, 2019, 9:30am UTC](https://forum.legato.io/t/client-stops-when-server-provider-stops/4544 "2019-07-09T09:30:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.opoka](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@m.opoka](https://forum.legato.io/u/m.opoka)\
**Post date:** [July 9, 2019, 9:30am UTC](https://forum.legato.io/t/client-stops-when-server-provider-stops/4544/1 "2019-07-09T09:30:07Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mehdiALL1](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mehdiALL1](https://forum.legato.io/u/mehdiALL1)\
**Post date:** [July 30, 2019, 10:11am UTC](https://forum.legato.io/t/client-stops-when-server-provider-stops/4544/2 "2019-07-30T10:11:07Z")

</div>

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

Thank you  
BR

---

<div class="post-metadata">

**Author:** ![m.opoka](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@m.opoka](https://forum.legato.io/u/m.opoka)\
**Post date:** [August 14, 2019, 5:50am UTC](https://forum.legato.io/t/client-stops-when-server-provider-stops/4544/3 "2019-08-14T05:50:26Z")

</div>

@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,

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [August 19, 2019, 5:33pm UTC](https://forum.legato.io/t/client-stops-when-server-provider-stops/4544/4 "2019-08-19T17:33:44Z")

</div>

Hi @m.opoka, could you have a look at [API detect unexpected client disconnection - #4 by oabid](https://forum.legato.io/t/api-detect-unexpected-client-disconnection/3455/4) ?

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`

---

<div class="post-metadata">

**Author:** ![CoRfr](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/corfr/32/69_2.png) [@CoRfr](https://forum.legato.io/u/CoRfr)\
**Post date:** [August 19, 2019, 6:16pm UTC](https://forum.legato.io/t/client-stops-when-server-provider-stops/4544/5 "2019-08-19T18:16:46Z")

</div>

I realize that we don’t have that much doc on these API client functions (it should be here: [C Language Support - Legato Docs](https://docs.legato.io/latest/apiFilesC.html#apiFilesC_client) , but it’s not), so I created a ticket for us to do so.
