in reply to Multiple Daemons - same script?

I think you can use select RBITS,WBITS,EBITS,TIMEOUT on the server sockets then call accept on the one that returns. Sorry, I don't have time to elaborate or to try this at the moment.