Search code examples
c++qtsocketsqtcpsocketqtcpserver

Qt:Design QtcpSocket to connect with Multiple TcpServer?


I want to design an Application with QTcpSocket to connect to multiple servers and get data from each server and display it on the GUI.

A QTcpServer with multiple Client is quiet easy. But I need to design my application in a very similar way.

In my application i need to connect to 40 devices ( Servers). These devices gets data through some sources and they transfer this data to my application. In my application, the data recieved from the individual server, will be splitted and displayed in the prescribed format along with the server details such as IP address port number etc.

Single Socket-Server communication is done but I wonder about the effective way to connect to multiple server via single socket??

Can any one guide me the effective ways to connect to multiple TcpServer and recieve data from each server ??

Any Idea, Suggestions, Links are most welcome.

Thanks in Advance.


Solution

  • A single QTcpSocket is designed to connect to a single server. You will need 40 QTcpSockets to connect to 40 QTcpServers simultaneously.