[Interest] UDP broadcast on Winphone

Federico Buti bacarozzo at gmail.com
Mon Oct 19 19:55:44 CEST 2015


Hi list.

According to multiple sources, UDP broadcast is supported on WinPhone 8+
(e.g. look here
<http://stackoverflow.com/questions/23504957/windows-phone-8-1-doesnt-send-udp-broadcast>
, here
<http://metronuggets.com/2013/03/18/how-to-send-and-receive-a-udp-broadcast-in-windows-phone-8-and-win8/>
or
here
<http://01siddharth.blogspot.it/2014/08/send-and-receive-udp-broadcast-in.html>)
but it seems that the feature in not supported in Qt since CanBroadcast
flag is set to false in QNetworkInterface (or am I misinterpreting?)
The test code I've used is as simple as the following:


udpSocket->bind(BROADCAST_PORT);
udpSocket->writeDatagram(data, length, a.broadcast(), BROADCAST_PORT);


A 4-bytes message is sent on a network where our target device is
connected. The sent message is correctly received by the target BUT the
answer we receive back is plain wrong. At least, the length of the messages
match the expected lengths:


\0x00cdcdcd // original message sent by my code - 4 bytes
\0x00cdcdcdcdcdcdcdcdcdcdcdcdcdcd // answer from the target device - 15
bytes


The very same code works fine on other platforms. Any idea or suggestion?
Thanks in advance,
F.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20151019/56d47f01/attachment.html>


More information about the Interest mailing list