I'm currently working on some code for this, but in case I forget to come back to post to the board, or in case it takes me a while, why not just have a separate background job running (started up via the shell) that tracks which sockets are available to clients ? Then all you'd have to do is communicate with the one job (or perhaps its own mini-server) run in the background that keeps an array of the available sockets for the server. This seems the most natural alternative since PHP disclaims that process control functionality should not be used in a web-server environment. I would hate to build a server, especially one with high traffic, that had to run through a loop in order to find an available socket.