private function isSocketDead($socketResource) { return !is_resource($socketResource) || @feof($socketResource); }