I am working with a piece of custom hardware (black box) that is sending UDP packets of data. Looking at the packets in Wireshark I can see that the hardware has the source IP set to 192.168.1.128 on port 4096 and the destination IP set to 0.0.0.0 on port 8192.

I am running a small Qt application on a Windows 7 machine that opens a UDP listener on port 8192 and should display packet data when it is received but, it never receives a packet. At this point I don't care what the data looks like I just want to verfiy that I can receive UDP from the external hardware.

Is this an operating system issue such that Windows will not receive a packet with destination set to 0.0.0.0? Should I use winpcap lib?

Any insight is most appreciated.

I have included an example of the UDP listener code.

Qt Code:
  1. Gui::Gui(QWidget *parent)
  2. : QMainWindow(parent){
  3. ui.setupUi(this);
  4.  
  5. udpSocket = new QUdpSocket(this);
  6.  
  7. connect(udpSocket, SIGNAL(readyRead()), this, SLOT(processPendingDatagrams()));
  8.  
  9. udpSocket->bind(8192);
  10.  
  11. setWindowTitle(tr("Display"));
  12. }
  13.  
  14. void SeekerGui::processPendingDatagrams()
  15. {
  16. while (udpSocket->hasPendingDatagrams())
  17. {
  18. QByteArray datagram;
  19.  
  20. datagram.resize(udpSocket->pendingDatagramSize());
  21.  
  22. udpSocket->readDatagram(datagram.data(), datagram.size());
  23.  
  24. ui.lineEdit_test->setText(tr("Received datagram: \"%1\"").arg(datagram.data()));
  25. }
  26. }
To copy to clipboard, switch view to plain text mode