I am trying to design a multithreaded web server in C using Pthreads and i am having a problem in accepting more incoming connections without serving them.
I want to put the file descriptor of each recieved connection in a buffer to be pocessed by a thread, Im using default accept(2) for accepting clients connections.
should i be using select ? any suggestion ?
A common way of doing multi-threaded servers is to create a new thread right after you accept a new connection, and pass the new socket to that thread. Something like this: