[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] lwIP malloc fail
From: |
Simon Goldschmidt |
Subject: |
Re: [lwip-users] lwIP malloc fail |
Date: |
Wed, 14 Apr 2010 07:38:57 +0200 |
"Navcon - Pedro Paulo Santos" wrote:
> The main mistake I did was that I tried to send all the data in the recv
> callback function. As I realized, lwIP received the ACK, but didn't freed
> the memory because it does so in other handler (unknown for me) different
> from recv.
Which memory isn't freed? The pbufs queued for sending/retransmission should be
freed *before* your receive callback is called, so this shouldn't be a problem.
However, you can only send as much data as fits into the buffers when you are
in the recv callback. If you have more data than that, the *sent* callback gets
called if an ACK is received and you can send more data from there.
The HTTP server in CVS contrib has no problems doing it this way.
> The latency can be improve for really small tranfers by sending
> in the recv function, but I would not suggest this.
That's not true, there should be no problems sending from the recv callback
(i.e. calling tcp_write from that callback).
Simon
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01