On Mon, 2016-08-22 at 11:16 +0430, Aarian P. Aleahmad wrote:
> No I don't
> Plus, my application is just using some of nm features and it's not a
> "GLib application" (or whatever it is called). Thus I have no idea,
> how to have my own main function and have the glib's main at the same
> time, unless using pthreads and asking one thread to run MY main and
> the other to run glib's main.


Hi,


when using libnm, you need to integrate the glib main loop into your
application,
see for example: 
https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#id-1.4.2.6.10

alternatively, don't use libnm but directly access the D-Bus API. libnm
is nothing but a wrapper around the D-Bus API. See the examples in
NetworkManager's source tree and the documentation:
https://developer.gnome.org/NetworkManager/unstable/spec.html


Thomas

> 
> On Sun, Aug 21, 2016 at 3:34 PM, Thomas Haller <thal...@redhat.com>
> wrote:
> > On Sun, 2016-08-21 at 11:57 +0430, Aarian P. Aleahmad wrote:
> > > Hi everyone
> > >
> > > On 19 Feb 2013, an issue was reported on "nm_device_get_state"
> > > function by David Feeney here, and was answered by Dan
> > Williams here.
> > > Unfortunately I'm having the same issue here too, and the topic
> > > couldn't help me. I would thank you if you help me to know about
> > > possible solutions.
> > >
> > 
> > Hi,
> > 
> > 
> > Dan suggested that the original issue was that the reporter didn't
> > use
> > a glib mainloop.
> > The mainloop is a mechanism where the main thread processes events.
> > libnm depends on that.
> > 
> > Do you have a glib mainloop properly setup?
> > 
> > See for example https://cgit.freedesktop.org/NetworkManager/Network
> > Manager/tree/examples/C/glib/list-connections-
> > libnm.c?id=805925f9efbc910975104bebe1050f0c663b61f7
> > 
> > 
> > Thomas
> 

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to