How to implement TCP communication with QT
-
Hello
I am trying to implement multi-threaded tcp communication.
Is it better to use a separate thread in the client program as well?
Or is it better to do it on the main thread?
Looking at the example, it seems that the server program uses a separate thread, but the client program does not normally use a thread.
Should the client also use threads?
Thank you for reading my poor English. -
@LISP said in How to implement TCP communication with QT:
Is it better to use a separate thread in the client program as well?
Only if really needed. Qt is assynchronous, so usually there is no need for additional threads. You only need threads if the main thread becomes too busy. But that is something you need to know or to test.
How many connections do you want to maintain at the same time?
If client has only one connection there is absolutelly no need for any threads.