I am trying to port a Linux application to Windows that highly depends on GLib. I compiled GLib with MSVC 2015. The application uses g_poll() in a place. In g_poll() GNOME documentation, it states that
If you need to use g_poll() in code that has to run on Windows, the easiest solution is to construct all of your GPollFDswith g_io_channel_win32_make _pollfd().
I will provide some small code segments to provide you insight:
As you might guess, in arv_gv_discover_socket_list_new() function, GPollFDs are created and in _discover() function, a broadcast message is sent and then polled for reply. but no luck, still in _discover(), it time outs. By the way, in Linux, the same application works smootly.
I also checked the discovery packet was actually emitted, and I saw a camera discovery ack packet coming to my network adapter via WireShark.
Since I am newbie to GLib, I cannot be sure if this modification is incorrect or GLib implementation is incorrect. Can you help me to resolve the problem?
I recently committed a W32 g_poll() test to glib git master. You can find it
If you look closely, you'll realize that g_poll() does almost nothing - it's
just a glorified WaitForMultipleObjectsEx(). All the magic happens in GSource
implementation, and that's what you must use, unless you're willing to do what
i did in that test and do all the pre- and post-processing yourself. Note that
i omitted a lot of corner cases in the test though.