If you are adventurous enough, you could try threads, but using them is "officially discouraged" (though not (yet) deprecated).
Lowering the read size, while very simple, will significantly degrade performance.
Non-blocking writes will add a lot of complexity. I think you will have to select on writability as well as readability.
If there is known maximum number of clients, you could pre-fork "worker" processes. Your "master" process would listen for connect requests, then "hand" them off to the next available worker. Unfortuantely, it has been many years since I did something like that, so I don't remember how to do the "hand off".
Unless there are performance or resource reasons to not use the fork-on-demand model, is probably best to just stay with that.
In reply to Re: Many sockets under one select
by RonW
in thread Many sockets under one select
by linxdev
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |