ale301168
6th July 2011, 21:07
Hi all,
I have written a simple protocol using QUdpSocket. The protocol needs to broadcast
some data to the multicast address 239.0.0.104 - port 65000 and, at the same time,
receive data from any peers over the network which transmit to the same multicast
address and port. The sender and receiver functions are independent, that is both
functions may begin to work without any synchronism.
To implement the protocol I have used only one socket which is bound to the port
65000 and belonging to the group 239.0.0.104 to receive datagrams and, when it
needs to transmit, the socket uses the group 239.0.0.104 as destination address
and the port 65000 as destination port.
The problem I have concerns the sending of datagrams. If the sender function starts
to work before the receiver one, datagrams are not sent over the network but
only to my application since it's listening on the same port. But, if the receiver
function starts to work before the sender one, I'm able to transmit datagrams.
I have detected this behaviour using Qt 4.7.3 and a PC hosting Windows CE 5.0. If
I port the application on a PC hosting Windows XP/Vista, I have no problem sending
datagrams also if I have not still received anything.
Thank you for your cooperation
Best Regards
/Alessandro
I have written a simple protocol using QUdpSocket. The protocol needs to broadcast
some data to the multicast address 239.0.0.104 - port 65000 and, at the same time,
receive data from any peers over the network which transmit to the same multicast
address and port. The sender and receiver functions are independent, that is both
functions may begin to work without any synchronism.
To implement the protocol I have used only one socket which is bound to the port
65000 and belonging to the group 239.0.0.104 to receive datagrams and, when it
needs to transmit, the socket uses the group 239.0.0.104 as destination address
and the port 65000 as destination port.
The problem I have concerns the sending of datagrams. If the sender function starts
to work before the receiver one, datagrams are not sent over the network but
only to my application since it's listening on the same port. But, if the receiver
function starts to work before the sender one, I'm able to transmit datagrams.
I have detected this behaviour using Qt 4.7.3 and a PC hosting Windows CE 5.0. If
I port the application on a PC hosting Windows XP/Vista, I have no problem sending
datagrams also if I have not still received anything.
Thank you for your cooperation
Best Regards
/Alessandro