Reputation: 417
I want to design server which supports multiple clients. I have thought of solution for designing multi client server.
The solution is: I can create thread for each client in server.Each thread will handle the communication with each client.
Now suppose if there are 50 clients then 50 threads will be generated at server side.
But if there are 1000 clients then 1000 threads will be generated at server.Which is not good solution.(because handling 1000 threads for system will not be such easy,i think so.)
Or above design will work fine if we are assuming that server has the more memory,powerful processor etc.
will above solution is good for my design? If it is not good then is there any other way to develop multi client server in qt?
Upvotes: 2
Views: 262
Reputation: 5674
I would recomand you to have a look over I/O Completion Ports of MSDN
https://msdn.microsoft.com/en-us/library/windows/desktop/aa365198(v=vs.85).aspx
http://www.codeproject.com/Articles/13382/A-simple-application-using-I-O-Completion-Ports-an
It is a patent of microsoft in order to maintain a big number of socket and handling the request from them by using number of cores * 2 as the amounts of threads to handle the sockets, i used to to handle 4000 sockets on 8 core server to handle 4000 streams of RTP
Upvotes: 1