Also, I came over jabberd2, as I had some trouble setting up the multi-user conference module.
While setting up the "muc", I realized that I just added a module without havng to do anything special, and that module is running a separate process. It's as if you could add an apache2 module without having to restart httpd or anything.
So I looked at the source code. And guess what, it seems I'm not alone thinking this way.
The trick is simple: if your process is more I/O bound than CPU bound, use non-blocking I/O and block when you want with select(). That works particularly well if processing the "packets" is done in constant time and that "slower packets" are processed in parallel processes. Like in jabberd2.
I'm fed up of seing every single TCP server using either forking processes or threads on every new connection. You don't have to do neither! jabberd2 has 5 processes, one thread per process, TOTAL.
Anyways, it's nice to see that some of the ideas I had for ANet were not that crazy...