AW: Re: [En-Nut-Discussion] Webserver Image problem

Oliver Schulz Oliver.Schulz at bong.de
Fri Dec 19 12:41:27 CET 2003


Hi Again,

[...]
> 
> But if there are some bytes in the buffer and the stream is 
> closed by fclose
> these bytes are not sent to the nic and the buffer is lost. Even
> NutTcpCloseSocket does not check the output buffer. (Hope I 
> did not overlook
> something..)
Yes, I did overlook something.
When working with socket streams provided by _fdopen, Nut/OS internally works with the NUTVIRTUALDEVICE structure. By calling fclose on these streams Nut/OS doesn't call _close but calls _write(n, 0, 0). And that causes a output buffer flush.

That means, the output buffer from TCP sockets IS flushed by calling fclose.

Sorry, but these device, files, virtuals stuff is gonna be getting a little bit complicated... Never mind.


Merry Christmas and a happy new year.
Oliver.




More information about the En-Nut-Discussion mailing list