Re: Libnm async functions and GMainLoop



On Thu, 2016-03-17 at 11:01 +0100, Thomas Haller wrote:
On Wed, 2016-03-16 at 16:03 -0700, Aaron Zinghini wrote:

When using async functions such as
"nm_client_activate_connection_async" I am not getting the supplied
callback being called. Do I need to have a GMainLoop setup for
this?
Why isn't there a synchronous version of these functions?

Thanks
Hi,


you are using libnm, right? No, there is no synchronous version.
Not sure why, probably it is just a missing feature.

While there are many calls with both sync and async versions, we
recommend the async versions for a variety of reasons.  First the sync
versions can take along time to complete, since they may need to query
NetworkManager for a large amount of data.  They also may require user
interaction which depends entirely on the user to respond in a timely
manner.  Third, your application obviously cannot do anything during
the time the sync request is happening, which often leads to a sub-
optimal user experience, both from GUI and CLI type tools.

Dan


Yes, you always need a proper GMainLoop running. After all, libnm is
a
glib library, and that is a requirement.

It should be too complicated, have a look at:
https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examp
les/C/glib/add-connection-
libnm.c?id=e2040e5ebeae8e50e3f3b5a0e724fc9211866972



Thomas
_______________________________________________
networkmanager-list mailing list
networkmanager-list gnome org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]