[En-Nut-Discussion] Re: Problems with heap Memory
Guborev Sergei
dezzer at nm.ru
Sun Nov 27 23:59:52 CET 2005
NutTcpCloseSocket() is an answer, but in some situations it won't help.
This function don't destroy socket immediatly if any connection presents.
It will wait for "hand-shaking" with server instead. In my application there
was a lot of incoming data transfer during this time, so simetimes after
create-accept-send-close routine NutOS "forgot" about socket and allocated
memory. And after period of time heap comes to end.
I've used the following code (forced closing):
if(sock != 0 && NutTcpDeviceWrite(sock, 0, 0) == 0) {
NutTcpDestroySocket(sock);
}
Not a good solution, but maybe it helps somebody.
Best, Sergei.
More information about the En-Nut-Discussion
mailing list