]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Irc/extlib/phergie/Phergie/Driver/Streams.php
Revert "Merged in Phergie changes"
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / Driver / Streams.php
index 9f9e2585d2d7ff1f7bda8b90734b377f072a6fa1..3f2ce052b1fc780f60d2427881c73f001137d8d8 100755 (executable)
@@ -219,15 +219,17 @@ class Phergie_Driver_Streams extends Phergie_Driver_Abstract
      */
     public function getEvent()
     {
-        // Check for a new event on the current connection
-        $buffer = fgets($this->socket, 512);
-        if ($buffer === false) {
+        // Check the socket is still active
+        if (feof($this->socket)) {
             throw new Phergie_Driver_Exception(
-                'Unable to read from socket',
+                'EOF detected on socket',
                 Phergie_Driver_Exception::ERR_CONNECTION_READ_FAILED
             );
         }
 
+        // Check for a new event on the current connection
+        $buffer = fgets($this->socket, 512);
+
         // If no new event was found, return NULL
         if (empty($buffer)) {
             return null;