Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.0 RC2
-
None
Description
hi
I've found a bug related to readyRead signal in QUdpSocket class, I have not tested it in other subclasses of QAbstractSocket but it might occur the same thing.
considering the attached project, if we use QueuedConnection, it will stop firing readyRead signal after a while.
I've gone deeper and found that there might be a situation in which hasPendingDatagram() returns false at the first try in the connected slot, so the signal emission won't get enabled again(to provide more detail, Qt itself has a flag to determine if it's needed to send readyRead signal on each new data or not, this flag is set and ReadyRead get disabled, after calling receiveDatagram(), the flag and signal emission will be enabled again, so if received a signal but don't call receiveDatagram(), emission won't be activated.)
to overcome this problem (temporarily), you must either use a direct connection or call
socket->readDatagram(0,0) explicitly after getting the signal, regardless of having any pending datagram or not.
I've generated the traffic using this command:
iperf -u -p 8888 -c 192.168.1.102 -n 200000M -b 10M
which 192.168.1.102 is my local ip address.
thank you all and have a nice day