title: PHP Mongo Error reading from socket
body: <p>The last couple of days, my error log has been filled with this error:</p>
  
  <pre><code>send_package: error reading from socket: The socket is closed
  </code></pre>
  
  <p>I really don't know where this is coming from. It would seem that my MongoDB server is not opening the TCP socket, but I really am just guessing.</p>
  
  <p>Has anyone seen this error before or know how to handle it?</p>
  
  <p>The line generating the error is:</p>
  
  <pre><code>$mongo = new Mongo("mongodb://user:pwd@host/db",array('timeout'=&gt;6000));
  </code></pre>
  
  <p>I'm also occasionally getting in from within the Pimple DIC:</p>
  
  <pre><code>    class HurstDI extends \Pimple
      {
          public function __construct(){
              $this['mongoUser'] = 'user';
              $this['mongoPwd'] = 'pwd';
              $this['mongoHost'] = "host/db";
              $this['mongoTimeout'] = 6000;
              $this['mongodb'] = function($c){
              return new \MongoClient("mongodb://{$c['mongoUser']}:{$c['mongoPwd']}@{$c['mongoHost']}");
          };
      }
      }
  </code></pre>