we are trying to implement an application which retrieves data from multiple servers, so we need several QTcpSocket instances in order to manage the connections for each host.
We are facing some decisional "design" problems:
- should we implement a multi-threading solution to reach the goal? (probably yes)
- if Yes, should we use a "worker thread" ( e.g as in the
QThread
examplemoveToThread(socket_)
) as best solution or there are better ? We need to manage three or more connections simultaneously, so we cannot usewaitingForConnection(...)
because is a blocking function (from what we understand) - what is the best practice for
QTcpSocket
reconnection? Maybe aQTimer
, but what is the best way to use it...?
Thank you in advance!
AD