P
P
PeroPero2017-12-18 13:09:27
Qt
PeroPero, 2017-12-18 13:09:27

Is there a significant difference in the speed of Qt with output to the console or writing to QString and output?

I send an http request to a web server, I get a response, but

m_sslSoc->write(get); //отправляю Get запрос на 2ip
while (m_sslSoc->waitForReadyRead()){ //читаю ответ
      str+=m_sslSoc->readAll();//записываю ответ в QString str
}
emit m_readRequest(str);//создаю сигнал и передаю в нем ответ 
//потом где то в main.cpp в слоте его вывожу через qDebug() << str;

But if it is displayed immediately in the qDebug() << m_sslSoc->readAll(); the answer is displayed 6 times faster. What am I doing wrong ? How to speed up execution?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PeroPero, 2017-12-19
@PeroPero

The problem was in waitForReadyRead() by default it has a delay of 3000ms. I apologize for my carelessness.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question