There is no one proper answer to that question. select() in a single thread should be fine and in most cases more efficient than using multiple threads. Especially if processing time of the data received from the socket is short.
There is no one proper answer to that question. select() in a single thread should be fine and in most cases more efficient than using multiple threads. Especially if processing time of the data received from the socket is short.
Each approach has its qualities and defects. The select one has speed but isi s more complex to program and have a hardcoded limit to how many sockets it can handle each time (the fd_set struct size).
I suggest you to look the "Unix Network Programming 3rd" book and accord with yout project choose the more suitable one.
Bookmarks