ay.
     */
    if (!eof)
        fwrite(buf, 1, readbytes, stdout);
} while (!eof);
/* In case the response didn&#39;t finish with a newline we add one now */
printf(&quot;\n&quot;);</code></pre>

<p>The main difference this time is that it is valid for us to receive an EOF response when trying to read data from the server. This will occur when the server closes down the connection after sending all the data in its response.</p>

<p>In this demo we just print out all the data we&#39;ve received back in the