*/
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;