PHP: How to use socket_select() and socket_read() correctly

I have a multithreaded PHP application that uses sockets for communicating between threads. The communication works pretty well, except for one thing: when I call socket_select(), it works the first time after a new connection is made, but after that it always reports read handles ready, even after I've read all the data from them. Here's what I mean:

Main thread:

  1. Setup socket, bind to port, listen
  2. socket_select() (block, with null timeout to make it wait forever) on the socket from step 1
  3. That call works fine: after the child thread connects, socket_select() tells me that the socket from step 1 is ready
  4. Accept new connection, remember the handle returned by accept().
  5. socket_select() on the main socket plus the new socket
  6. After child thread writes, socket_select() reports that the new socket is ready
  7. I read all the data from the socket, then go back to step 5.

At this point, socket_select() continues to report that the new socket is ready, even though the child thread has written no new data to it. What in the world am I doing wrong? Is it convention to close the new connection at this point and have the child thread reconnect? How can I get socket_select() to stop reporting that the new handle is ready to read?