private function send($handle, $data, $length) { if (feof($handle) || fwrite($handle, $data, $length) !== $length) { $this->error = 'connection unexpectedly closed (timed out?)'; $this->connerror = true; return false; } return true; }