jdp/redisent — Issue #10: Infinite loop on broken pipe.
Author: gumayunov
Created: 2011-10-30 11:24:03+00:00
State: open

```php
for ($written = 0; $written < strlen($command); $written += $fwrite) {
$fwrite = fwrite($this->__sock, substr($command, $written));
if ($fwrite === FALSE) {
throw new Exception('Failed to write entire command to stream');
}
}
```

On broken pipe `fwrite` returns 0 and it will loops for ever.