title: Set a timeout on socket_read
body: <p>I was wondering how can I set a timeout on a <code>socket_read</code> call? The first time it calls <code>socket_read</code>, it waits till data is sent, and if no data is sent within 5 secs I want to shutdown the connection. Any Help? I already tried <code>SO_RCVTIMEO</code> with no luck.</p>
  
  <p>I'm creating a socket with <code>socket_create()</code> and listening on it for connections, then when connected I listen for the data and then do something with it. When the timeout hits, I want to run <code>socket_shutdown()</code> and then <code>socket_close()</code>.</p>