Is udp broadcast supported on Chrome Native Client (pnacl toolchain)?
I try to implement an Nacl module in a Chrome Extension that tries to discover GigE cameras using GigE Vision control service (gvcp). So I have to send an UDP broadcast message on port 3956. I use sendmsg() function for this purpose.
Inside my Nacl module (compiled using pnacl toolchain), I use nacl_io and I can successfully send an UDP message as soon as I use a classical host adddress (let say 192.168.1.12 for example). I could see the emitted message using Wireshark.
But when I switch to INADDR_BROADCAST address, I could see that my call to sendmsg() function is successfull (I send 4 bytes and the result of this call is well equal to 4)...but nothing really happens on the network. I cannot see any broadcast message sent using Wireshark.
Using Nacl logging, I cannot see any Nacl error in the logs.
I use pepper_56.
Please note that:
- I use an Ubuntu 16.10 distribution
- chrome version is 56.0.2924.87 (64-bit)
- chrome is started using --allow-nacl-socket-api=localhost
- pepper c++ API is used (well, the module is written using C++, but nacl_io calls are used: I do not rely directly on pp::UDPSocket...)
- nacl_io function calls are well made in a dedicated worker thread (well, if it was not the case, an EPERM error will have occured on any previous socket(), bind() calls and the example with the host address would fail also)
- I cannot use another call than sendmsg(). In fact, what I describe here is the behavior of a small reproducer for the issue but, in the end, I need to rely on glib which use the underlying sendmsg() function. So, please do not ask me to check send() or write() or ... :-) I need to stick to the sendmsg() function.
- URL used to load the html page that contains the reference to the Nacl module is http://localhost:5103. ie in development mode, I do not use Chrome extension ...
- ... but I have checked anyway in a Chrome extension (developper mode only) and the result is the same
- I am NOT developping a Chrome App (so, there is no Chrome App manifest, so no permissions to set etc...)
Is UDP broadcast supported in pepper_56 ? Any idea why it is not working ?