Howto activate the LowLatency on TCPClient on Windows
-
Hello,
I am Using Qt5.13.0/win/MInGW64bitI try to setup LowLatency TCP Connection
void MyInterface::socketConnected() { qDebug() << "socketConnected"; QTcpSocket *socket = static_cast<QTcpSocket *>(QObject::sender()); socket->setSocketOption(QAbstractSocket::LowDelayOption, 1); }
But I encounter still a 10msec delay. After write I also do flush for the socket.
When I check Socket Option then LowDelayOption is 1.please advice how to setup LowDelay on TCPClient socket.
Thanks, Adib.
-
@adib-taraben said in Howto activate the LowLatency on TCPClient on Windows:
But I encounter still a 10msec delay.
Are you calling flush() after write()?
-
yes, I do
byteswritten = socket->write(data, maxSize); socket->flush(); qDebug() << "latency: " << socket->socketOption(QAbstractSocket::LowDelayOption);
... and when I check theoption; it is still set to 1.
Adib.
-
Reading the documenation I don't see why the delay should be below 10ms - it only tells the OS to flush as fast as possible. How do you measure. And since this is an OS specific option I don't think Qt can do anything for it (except flushing it's internal buffers so the OS can do it's work which you're doing).
-
ah I forgot to mention:
there is no difference noticable when there is LowDelayOption not set.Adib.
-
Thats probably because LowDelayOption is something different than you expect.
So again the question: what do you measure (and how) resp. what is too slow for you.
Regards