title: How to receive proper UDP packet in QT?
body: <p>I am trying write a QT program to receive UDP packet.I am trying to receive from Packet Sender software
  This is my code</p>
  
  <pre><code>    socket = new QUdpSocket(this);
      bool result =  socket-&gt;bind(QHostAddress("150.100.50.88"),45454);
      qDebug() &lt;&lt; result;
      if(result)
      {
          qDebug &lt;&lt; "PASS";
      }
      else
      {
          qDebug &lt;&lt; "FAIL";
      }
      processPendingDatagrams();
      connect(socket, SIGNAL(readyRead()), this, SLOT(processPendingDatagrams()),Qt::QueuedConnection);
  
  
      void UDP::processPendingDatagrams() 
      {
          QHostAddress sender;
          u_int16_t port;
          while (socket-&gt;hasPendingDatagrams())
          {
              QByteArray datagram;
              datagram.resize(socket-&gt;pendingDatagramSize());
              socket-&gt;readDatagram(datagram.data(),datagram.size(),&amp;sender,&amp;port);
             qDebug() &lt;&lt;"Message From :: " &lt;&lt; sender.toString();
             qDebug() &lt;&lt;"Port From :: "&lt;&lt; port;
             qDebug() &lt;&lt;"Message :: " &lt;&lt; datagram;    
         } //! [2] 
     }
  </code></pre>
  
  <p>UDP.h:</p>
  
  <pre><code> class UDP : public QObject 
   {
   Q_OBJECT public:
   explicit UDP(QObject *parent = 0);
  
   signals:
  
   public slots:
   void SendDatagram(u_int8_t,u_int8_t,u_int8_t);
  
   private slots:
   void processPendingDatagrams();
  
   private :
   QUdpSocket *socket; 
   };
  </code></pre>
  
  <p>The readReady signal and corresponding slot are not working . I can see the packets in Wireshark.
  If a I try receive the packets in continuously in a loop I am able see the datagrams.What can be the reason for signals and Slots for not working.Sending operation is working well.</p>