Momergil
30th January 2013, 17:59
Hello!
I have an debug application with a QTcpSocket client that should receive something like 6 packages by second - that's precise. So I would imagine that the readyRead() signal would be emmited around 6 times per second, each time related to one of the packages that were send. But what happens is very different:
rather than emiting 6 singals per second well divided in time, usually 2 to 3 readyRead signals are emmited very quickly one after the other with the data received:
"0" "56:10:484" 8192 Data received (readyRead)
"0" "56:10:485" 323 Data received (readyRead)
"0" "56:11:358" 8192 Data received (readyRead)
"0" "56:11:358" 323 Data received (readyRead)
"0" "56:12:340" 3472 Data received (readyRead)
"0" "56:12:340" 5043 Data received (readyRead)
"0" "56:13:542" 3472 Data received (readyRead)
"0" "56:13:542" 5043 Data received (readyRead)
"0" "56:14:306" 8192 Data received (readyRead)
"0" "56:14:306" 323 Data received (readyRead)
"0" "56:15:397" 3472 Data received (readyRead)
"0" "56:15:398" 5043 Data received (readyRead)
(the number before "Data received" is get by bytesAvailable())
And that happens, as you may see, like once per second. Is there a way to change this behaviour making readyRead() be emitted in a way closer to what was expected? It's like if there was a thread inside QIODevice that looks for new data once per second...
Thanks,
Momergil
Obs.: maybe has something to do with [http://www.qtcentre.org/threads/15023-Question-in-readyRead(QTCPSOCKET)]
I have an debug application with a QTcpSocket client that should receive something like 6 packages by second - that's precise. So I would imagine that the readyRead() signal would be emmited around 6 times per second, each time related to one of the packages that were send. But what happens is very different:
rather than emiting 6 singals per second well divided in time, usually 2 to 3 readyRead signals are emmited very quickly one after the other with the data received:
"0" "56:10:484" 8192 Data received (readyRead)
"0" "56:10:485" 323 Data received (readyRead)
"0" "56:11:358" 8192 Data received (readyRead)
"0" "56:11:358" 323 Data received (readyRead)
"0" "56:12:340" 3472 Data received (readyRead)
"0" "56:12:340" 5043 Data received (readyRead)
"0" "56:13:542" 3472 Data received (readyRead)
"0" "56:13:542" 5043 Data received (readyRead)
"0" "56:14:306" 8192 Data received (readyRead)
"0" "56:14:306" 323 Data received (readyRead)
"0" "56:15:397" 3472 Data received (readyRead)
"0" "56:15:398" 5043 Data received (readyRead)
(the number before "Data received" is get by bytesAvailable())
And that happens, as you may see, like once per second. Is there a way to change this behaviour making readyRead() be emitted in a way closer to what was expected? It's like if there was a thread inside QIODevice that looks for new data once per second...
Thanks,
Momergil
Obs.: maybe has something to do with [http://www.qtcentre.org/threads/15023-Question-in-readyRead(QTCPSOCKET)]