Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Not all packets received by QUdpSocket
Qt 6.12 LTS is out! See what's new in the release blog

Not all packets received by QUdpSocket

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anticross
    wrote on last edited by
    #1

    I've got QUdpSocket binding some port. I make a slot which I connect with signal readyRead(). Looks like this:
    @ while (m_socket->hasPendingDatagrams()) {
    QByteArray datagram;
    datagram.resize(m_socket->pendingDatagramSize());
    QHostAddress sender;
    quint16 senderPort;
    m_socket->readDatagram(datagram.data(), datagram.size(), &sender, &senderPort);
    processDatagram(datagram, sender, senderPort);
    }@
    When I send a lot of datagrams(200 or more) from another program to binding port I receive not all of them (but in Wireshark I can see all of them). If I make some waiting before sending each command I receive them all.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      I guess you are aware of the implications of udp. There is no guarantee to receive all packets nor to receive them all in the right sequence.

      For your application do you check this in debug mode and in the debugger?

      If, yes, this might have additional delays in processing which might explain the missing packages.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Anticross
        wrote on last edited by
        #3

        I'm talking not about sequence I'm talking about number of datagrams. From one side I sent 200 datagrams, from another(in debuger mode) in slot I received only 50. In Wireshark I see all 200, that means that packets received by network interface without losses.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          [quote author="koahnig" date="1376915486"]
          For your application do you check this in debug mode and in the debugger?

          If, yes, this might have additional delays in processing which might explain the missing packages. [/quote]

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • W Offline
            W Offline
            wangyinhu
            wrote on last edited by
            #5

            I have this problem too . wireshark show my computer have received all the pack,but my qudpsocket can't.
            In my case,when I minimize my qt app window ,my app can receive all the pack with no problem.BUT when I move my mouse pointer around over my app, qudpsocket loss pack badly.

            1 Reply Last reply
            0
            • W Offline
              W Offline
              wangyinhu
              wrote on last edited by
              #6

              I have this problem too . wireshark show my computer have received all the pack,but my qudpsocket can't.
              In my case,when I minimize my qt app window ,my app can receive all the pack with no problem.BUT when I move my mouse pointer around over my app, qudpsocket loss pack badly.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt
              • Unsolved