By the way,
<application>telnet
</application> prints the
<emphasis>Connection closed by foreign host
</emphasis> message after our daemon has closed the socket. This shows us that, indeed, using
<function>fclose(client);
</function> in our code works as advertised.