in reply to Socket shell ...

I would take a look at POE. POE will handle all socket, server and process work for you in a nonblocking manner. POE is a huge framework. If you can give more details and show some code, I can point you to the modules you can use.