Kill dlt client while dlt-daemon is not running

424 Views Asked by At

I've builded a C++ application which uses DLT on linux target. I catch the ^C event with a signal handler, unregister app and all contexts and then simply exit(1);

If I kill my application with ctrl+C while the dlt-daemon is running everything works properly, but if I start and then kill my application while dlt-daemon is not running, the exit is delayed about 10 seconds and if I keep pressing ctrl+C few times the terminal get stuck.

What can I do in my code in order to kill the application immediately?

1

There are 1 best solutions below

0
On

I would like to correct some points:

  1. Any dlt-client cannot start if there is no dlt-daemon available.
  2. dlt-user (application) using libdlt so even there is no dlt-daemon, your logs still being kept in libdlt ringbuffer, whenever a daemon starts, log fetched and kept in daemon buffer.
  3. For the delay, it is because of the mechanism of libdlt ring buffer to try to buffer all the remaining logs atexit inside itself, making sure that it has 1 last attempt of flushing logs before your app stops/exits completely.

Regards