Click to See Complete Forum and Search --> : client server modal basic problem!


vc185002
February 21st, 2006, 01:40 AM
hi, all
i m trying to code Client server model in C++.
Do we need a thread to handle a client means per client a thread is to be generated. Is there any other way so that we can handle more numbers of clients with some limited threads?

philkr
February 21st, 2006, 04:25 AM
You don't need a new thread for each client. But if you use synchronous functions you should create one extra thread for the whole network communication, because otherwise your main thread will be blocked.

Naumaan
February 23rd, 2006, 06:19 AM
Further more Winsock offers some interesting I/O models that help applications manage communication on one or more sockets at a time in an asynchronous fashion: select, WSAAsyncSelect, WSAEventSelect, overlapped I/O, and completion port. Search Information regarding these models on Internet and in MSDN it may helps u.