Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QT UDP RECEIVE

QT UDP RECEIVE

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
20 Posts 4 Posters 3.3k 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.
  • S Offline
    S Offline
    swansorter
    wrote on last edited by
    #1

    sir am able to receive all data in qt pc application but when i run same application on embedded Linux system (sama5d27 based board) am not able to receive all data.
    even tried change ring buffer of ethernet but i found no any changes.
    this my code udp receive pack

    void MainWindow::readPendingDatagrams()
    {
    while(mSocket->hasPendingDatagrams())
    {
    QByteArray datagram1;
    datagram1.resize(mSocket->pendingDatagramSize());
    mSocket->readDatagram(datagram1.data(),datagram1.size() );
    Rx_bytes_count+=datagram1.size();//counting received data
    mPayload.append(datagram1);//storing bunch by bunch data inside mPayload
    qDebug()<<Rx_bytes_count;
    }
    }
    is their any other method to receive to sped up the udp packet

    S jsulmJ JonBJ 3 Replies Last reply
    0
    • S swansorter

      sir am able to receive all data in qt pc application but when i run same application on embedded Linux system (sama5d27 based board) am not able to receive all data.
      even tried change ring buffer of ethernet but i found no any changes.
      this my code udp receive pack

      void MainWindow::readPendingDatagrams()
      {
      while(mSocket->hasPendingDatagrams())
      {
      QByteArray datagram1;
      datagram1.resize(mSocket->pendingDatagramSize());
      mSocket->readDatagram(datagram1.data(),datagram1.size() );
      Rx_bytes_count+=datagram1.size();//counting received data
      mPayload.append(datagram1);//storing bunch by bunch data inside mPayload
      qDebug()<<Rx_bytes_count;
      }
      }
      is their any other method to receive to sped up the udp packet

      S Offline
      S Offline
      swansorter
      wrote on last edited by
      #2

      @swansorter is their any method to speed up the udp receive

      1 Reply Last reply
      0
      • S swansorter

        sir am able to receive all data in qt pc application but when i run same application on embedded Linux system (sama5d27 based board) am not able to receive all data.
        even tried change ring buffer of ethernet but i found no any changes.
        this my code udp receive pack

        void MainWindow::readPendingDatagrams()
        {
        while(mSocket->hasPendingDatagrams())
        {
        QByteArray datagram1;
        datagram1.resize(mSocket->pendingDatagramSize());
        mSocket->readDatagram(datagram1.data(),datagram1.size() );
        Rx_bytes_count+=datagram1.size();//counting received data
        mPayload.append(datagram1);//storing bunch by bunch data inside mPayload
        qDebug()<<Rx_bytes_count;
        }
        }
        is their any other method to receive to sped up the udp packet

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @swansorter said in QT UDP RECEIVE:

        am not able to receive all data

        Then you should use TCP, UDP does NOT guarantee that everything will arrive.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        S 2 Replies Last reply
        2
        • S swansorter

          sir am able to receive all data in qt pc application but when i run same application on embedded Linux system (sama5d27 based board) am not able to receive all data.
          even tried change ring buffer of ethernet but i found no any changes.
          this my code udp receive pack

          void MainWindow::readPendingDatagrams()
          {
          while(mSocket->hasPendingDatagrams())
          {
          QByteArray datagram1;
          datagram1.resize(mSocket->pendingDatagramSize());
          mSocket->readDatagram(datagram1.data(),datagram1.size() );
          Rx_bytes_count+=datagram1.size();//counting received data
          mPayload.append(datagram1);//storing bunch by bunch data inside mPayload
          qDebug()<<Rx_bytes_count;
          }
          }
          is their any other method to receive to sped up the udp packet

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @swansorter
          Please read @jsulm's comment above. For some reason, this forum seems to see many developers saying they are using UDP (for some reason) and at the same time expecting to receive all data. UDP is simply the wrong protocol for this, one of the main points is that it allows packets to not arrive, that's what it's used for....

          S 2 Replies Last reply
          0
          • jsulmJ jsulm

            @swansorter said in QT UDP RECEIVE:

            am not able to receive all data

            Then you should use TCP, UDP does NOT guarantee that everything will arrive.

            S Offline
            S Offline
            swansorter
            wrote on last edited by
            #5

            Some times am able to receive but consistency not their
            in my ubuntu PC works fine

            1 Reply Last reply
            0
            • JonBJ JonB

              @swansorter
              Please read @jsulm's comment above. For some reason, this forum seems to see many developers saying they are using UDP (for some reason) and at the same time expecting to receive all data. UDP is simply the wrong protocol for this, one of the main points is that it allows packets to not arrive, that's what it's used for....

              S Offline
              S Offline
              swansorter
              wrote on last edited by
              #6
              This post is deleted!
              S 1 Reply Last reply
              0
              • S swansorter

                This post is deleted!

                S Offline
                S Offline
                swansorter
                wrote on last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • JonBJ JonB

                  @swansorter
                  Please read @jsulm's comment above. For some reason, this forum seems to see many developers saying they are using UDP (for some reason) and at the same time expecting to receive all data. UDP is simply the wrong protocol for this, one of the main points is that it allows packets to not arrive, that's what it's used for....

                  S Offline
                  S Offline
                  swansorter
                  wrote on last edited by
                  #8

                  @JonB i checked all pc ethernet setting and embedded platform ethernet setting all are same

                  JonBJ 1 Reply Last reply
                  0
                  • S swansorter

                    @JonB i checked all pc ethernet setting and embedded platform ethernet setting all are same

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #9

                    @swansorter
                    You are ignoring what @jsulm & I are telling you about UDP. Go read up about it.

                    1 Reply Last reply
                    1
                    • jsulmJ jsulm

                      @swansorter said in QT UDP RECEIVE:

                      am not able to receive all data

                      Then you should use TCP, UDP does NOT guarantee that everything will arrive.

                      S Offline
                      S Offline
                      swansorter
                      wrote on last edited by
                      #10

                      @jsulm our hardware based on udp

                      JonBJ 1 Reply Last reply
                      0
                      • S swansorter

                        @jsulm our hardware based on udp

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #11

                        @swansorter
                        Then presumably it's intended that receivers (like your app) can miss sent packets, and that's OK?

                        What you should do is find whatever the Linux equivalent of Windows' WireShark is and check what is actually being sent/received where. If you are missing packets it should not be because you are using QT UDP code, any UDP code should miss them.

                        S 1 Reply Last reply
                        0
                        • JonBJ JonB

                          @swansorter
                          Then presumably it's intended that receivers (like your app) can miss sent packets, and that's OK?

                          What you should do is find whatever the Linux equivalent of Windows' WireShark is and check what is actually being sent/received where. If you are missing packets it should not be because you are using QT UDP code, any UDP code should miss them.

                          S Offline
                          S Offline
                          swansorter
                          wrote on last edited by
                          #12

                          @JonB I am able to receive all packet using 60 cm cable ,but when i use 180 cm cable not able to receive all the packet
                          1.In my pc qt application able to receive all the packets in both the cable

                          S JonBJ 2 Replies Last reply
                          0
                          • S swansorter

                            @JonB I am able to receive all packet using 60 cm cable ,but when i use 180 cm cable not able to receive all the packet
                            1.In my pc qt application able to receive all the packets in both the cable

                            S Offline
                            S Offline
                            swansorter
                            wrote on last edited by
                            #13

                            @swansorter How to do Qt udp recevie using thread

                            1 Reply Last reply
                            0
                            • S swansorter

                              @JonB I am able to receive all packet using 60 cm cable ,but when i use 180 cm cable not able to receive all the packet
                              1.In my pc qt application able to receive all the packets in both the cable

                              JonBJ Offline
                              JonBJ Offline
                              JonB
                              wrote on last edited by JonB
                              #14

                              @swansorter said in QT UDP RECEIVE:

                              I am able to receive all packet using 60 cm cable ,but when i use 180 cm cable not able to receive all the packet

                              Perhaps the speed of light is too slow in a cable three times as long?
                              I have to say this does not sound like a Qt issue....

                              S 1 Reply Last reply
                              0
                              • JonBJ JonB

                                @swansorter said in QT UDP RECEIVE:

                                I am able to receive all packet using 60 cm cable ,but when i use 180 cm cable not able to receive all the packet

                                Perhaps the speed of light is too slow in a cable three times as long?
                                I have to say this does not sound like a Qt issue....

                                S Offline
                                S Offline
                                swansorter
                                wrote on last edited by
                                #15

                                @JonB But am able to receive in pc (QT application) with the bothe cable

                                1 Reply Last reply
                                0
                                • SGaistS Offline
                                  SGaistS Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #16

                                  Hi,

                                  You do realize that your target device does not have the same hardware as your desktop machine ?

                                  Therefore, your application can't compensate for weaknesses at the hardware level receptor.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  S 1 Reply Last reply
                                  1
                                  • SGaistS SGaist

                                    Hi,

                                    You do realize that your target device does not have the same hardware as your desktop machine ?

                                    Therefore, your application can't compensate for weaknesses at the hardware level receptor.

                                    S Offline
                                    S Offline
                                    swansorter
                                    wrote on last edited by swansorter
                                    #17

                                    @SGaist I checked the hardware.
                                    1.ethernet setting in pc and embedded device Ethernet setting bother are same
                                    100 mbps

                                    jsulmJ 1 Reply Last reply
                                    0
                                    • S swansorter

                                      @SGaist I checked the hardware.
                                      1.ethernet setting in pc and embedded device Ethernet setting bother are same
                                      100 mbps

                                      jsulmJ Offline
                                      jsulmJ Offline
                                      jsulm
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #18

                                      @swansorter The point was that your target device does not have same CPU/RAM power compared to your PC...

                                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      S 1 Reply Last reply
                                      0
                                      • jsulmJ jsulm

                                        @swansorter The point was that your target device does not have same CPU/RAM power compared to your PC...

                                        S Offline
                                        S Offline
                                        swansorter
                                        wrote on last edited by
                                        #19

                                        @jsulm but am getting zero packet loss while doing ping

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • S swansorter

                                          @jsulm but am getting zero packet loss while doing ping

                                          jsulmJ Offline
                                          jsulmJ Offline
                                          jsulm
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #20

                                          @swansorter So what? Ping does not cause same load as sending bigger amount of data...
                                          As already suggested: use TCP if you need to make sure all packets arrive...

                                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          1 Reply Last reply
                                          1

                                          • Login

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