[En-Nut-Discussion] _fdopen failed to create the stream on the socket

Harald Kipp harald.kipp at egnite.de
Thu Nov 12 17:55:27 CET 2009


Ma-Prokop, Yuhong wrote:

> Nut/Os Version: 4.4.0
> Target CPU: Ethernut 3.0E
> File System: UROM

Many bugfixes had been done since. Though, as far as I can remember
right now, none of them is related. I'll give it a try here.


> One more question related to my problem: if the browser closes the website DURING the webserver processing of "NutHttpProcessRequest(http_stream)", shall the stream be closed or the stream shall stay there? I have the feeling that the streams stay there and lead to memory leak.

After NutHttpProcessRequest() exits, both, the socket and the associated
stream needs to be closed. No matter whether to request had been fully
processed or the browser broke the connection.

NutHttpProcessRequest(stream);
fclose(stream);
NutTcpCloseSocket(sock);

Note, that the socket will stay alive in the background for a short time
in order to consume late packets. However, after a few seconds the free
heap space should return to its idle value. More or less, depending on
other applications.

No intention to upgrade to a later version? Specifically we added some
goodies for heap debugging:

http://lists.egnite.de/pipermail/en-nut-discussion/2009-April/010751.html

Harald



More information about the En-Nut-Discussion mailing list