I'm really going crazy over this and I hope somebody has an answer...
I do encounter a strange problem with QUdpSockets
and the Signal and Slot Connection. I'm receiving small data packets (64 bytes) at 3 different UdpSockets
with 100Hz without any processing afterwards. The Signal<-> Slot Connection for reading out the data seams to work completly fine on different laptops, but not on the pc it is supposed to run in the end, which has way more processing power than the laptops.
I'm running the same code on every machine with the same setup. The Problem is, the recvEvents
are somehow being queued and delayed up to several seconds on the pc, but not on the laptops. At first I thought It would be a network issue, but I already tried different network cards/switches etc.. and several other things. The only thing that helped is changing the receive code from signal<->slots to another thread with std::thread
, so it definitely has to do something with the connection from the readyRead
signal.Some Code:
connect(&udpSocket, &QUdpSocket::readyRead, this, &DataController::handleData);// Called with 100Hz
void handleData(){ //This function call is beeing delayed/queued....
udpSocket.readDatagram(&data,datasize);
}
My Question:
- Is there any limit of Events/seconds which can be handled?
- Do you have any suggestion where I can look for errors or how to
speed up the
QEventLoop
?
Im Running: Win10 Pro, VS 2017 64bit,Qt 5.11.2
BR mike