Search code examples
qtsocketsqthread

QUdpSocket and QThread


As far as I understand from the documentation the QUdpSocket are async but, still, reading from the socket is performed on the UI thread when the signal readyRead() is emitted. Is that correct? Is that safe from the performance perspective? Should I read the socket's content in another thread?


Solution

  • Everything depends if you will have a lot of data to process. I've used the TCP socket with avarage transfer ~20mbps without blocking gui. Best thing would be check it yourself. I think you won't have to move socket to other thread