QT UDP RECEIVE
-
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 packvoid 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 -
@swansorter is their any method to speed up the udp receive
-
@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.
-
@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.... -
Some times am able to receive but consistency not their
in my ubuntu PC works fine -
This post is deleted!
-
This post is deleted!
-
@swansorter
You are ignoring what @jsulm & I are telling you about UDP. Go read up about it. -
@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.
-
@swansorter How to do Qt udp recevie using thread
-
@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.... -
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.
-
@swansorter The point was that your target device does not have same CPU/RAM power compared to your PC...
-
@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...