How to use async methods in gdbus-codegen

In the picture attached , on right I have my client.c file and on left I have the signatures of the gdbus-codegen generated proxy creation methods .
WHY my code on right side is not working even not a single printf is getting printed as well as neither there’s any activity on server side although the synchronous versions work fine(in comment on right side) .

Your application quits immediately without iterating a GMainContext, so your async callbacks will never be dispatched. For anything more complicated than a test application, you should use GApplication and call g_application_run() and g_application_quit(). For simple test apps, it’s probably easiest to create a GMainLoop for the default main context, and call g_main_loop_run() and g_main_loop_quit(). You can also manually call g_main_context_iteration() for the default main context inside a while loop.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.