How to use a QTCPServer in multiple threads?
-
27-09-2019 - |
Question
I am trying to write a webserver that processes requests from multiple clients simultaneously. The way it is designed, only one request can be processed at a time.
What I need is a way to call nextPendingConnection()
and then dispatch the connection to a separate thread for processing.
Is there any way to do this?
Solution
This sample here should explain it http://doc.qt.io/qt-5/qtnetwork-threadedfortuneserver-example.html
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow