title: PHP Socket: Timeout and disable warnings
body: <p>I've got a simple question regarding socket_connect() for PHP.
  I'm using ajax to send a request on the fly to a script that connects to my server.
  When I get the result back I either get the value I want if the server was up, or I get "?" if the server was down.</p>
  
  <p>This is all great but two things:</p>
  
  <ul>
  <li><p>If socket_connect() fails (if the server is down) it will output a really huge warning on my page from the result. How do I disable this warning or any warnings that socket_connect or socket_send will output? I don't want to be cheap and just disable all PHP warnings as this isn't efficient.</p></li>
  <li><p>When it fails to connect, the timeout is pretty huge. I've tried socket_set_option but it still takes around 15 seconds:</p>
  
  <pre><code>socket_set_option($sock,  SOL_SOCKET,  SO_SNDTIMEO,  array("sec"=&gt;2, "usec"=&gt;0) );
  </code></pre></li>
  </ul>
  
  <p>Also Merry Christmas!</p>