Hi,
Ive made a couple of tcp socket-servers, common for all of them is that they
use an array of handles for each socket so i normally can maintain
communication of <63 sockets pr thread (WaitForMultipleOjects etc. etc.)
Now this is just fine, but now i want to extend the idea i have here, its a
multipurpose socketserver where each socket can communicate with different
clients (each talking their own "protocol"/"language") - therefore i want to
extend my design so each different type of client can be placed in a DLL,
and then i assign the incoming socket-handling to an instance of this DLL.
The reason why i want to do this, is to keep somekind of "driver" level, so
i can do alot of communcation in the DLL, but have a clean and cut
interfacelevel to the rest of the application - besides this it gives me
some advantages to have each socket placed in its own thread, its easy to
control it via queues etc.
Then i came to think of putting each and every socket in its own thread,
instead of doing the more optimized way of handling <63 sockets pr thread.
But take in consideration that im working with possible100-200 active
sockets, and im wondering if that would be completely insain to put on a
windows-machine ? i know there shouldnt be an upper-limit for threads
(depending on memory) and as long as they just sit there and wait, i cant
see it would put load on the system.
But how do you feel ? would it be very bad design ? or can you recommend
other ideas ?