Finally it works, but:
If i want to make it more efficient, the way would be to create a limited number of Threads, and in this Threads create a limited number of QTcpSocket Object for every connection?
Finally it works, but:
If i want to make it more efficient, the way would be to create a limited number of Threads, and in this Threads create a limited number of QTcpSocket Object for every connection?
Have a pool of threads and a queue of connections. When a new connection comes in, assign it to one of idle threads if there are any or queue the connection so that when a thread becomes idle, it will pick it up and handle it. When a thread handles a predefined number of requests (say.... 200?) it dies and a new thread is spawned in its place. You can use the same model with processes instead of threads.
Bookmarks