[Resolved]Broadcast problem in embedded system



  • Hi guys:
    I wrote a program that will send boradcast packet through QUdpsocket. I transfer this program to my board(Beagleboneblack) and run it. I found if I used this code like following:
    @cQUdpSocket->writeDatagram(info,info.length,QHostAddress::Broadcast,30000)@

    i would get the error message "Unable to send a message"
    If i use this code like following, everything is OK.
    @cQUdpSocket->writeDatagram(info,info.length,QHostAddress(169.254.255.255),30000)@

    Does anyone know why???

    P.S. If i run the same program on the linux PC, above two cases are all could work.



  • Hi guys:
    I add a code and everything is ok. Hope this can help other people. But i still don't know why this can work.
    @system("ip route add 255.255.255.255 dev eth0");@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.