Click to See Complete Forum and Search --> : Question about Building a Server


Shvalb
February 15th, 2009, 09:05 AM
Hi.

I'm building a sever that can serve many client simulatenusly, so I have the main thread which has a socket opened for listening and accepting new connection, and for each new socket I place it in a data-structure.

my question is: how to make this single thread accepts new sockets and also when a user (that's already connected) sends data to handle it ....?!?! my accept() is non-blocking and I use overlapping sockets.

I hope I'm being clear......

Thanks.

ckweius
February 16th, 2009, 12:23 AM
For non-blocking sockets, you can mulitplex between server socket and any active client sockets using select().

Kevin Choong