lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-users] tcp_write and dynamic data (was: Optimizing TCP writes)


From: Bill Auerbach
Subject: RE: [lwip-users] tcp_write and dynamic data (was: Optimizing TCP writes)
Date: Fri, 7 Mar 2008 09:55:34 -0500

Jonathan,

While debugging this, I found a much more serious problem to now deal with.
Once resolved, I'll continue on the original problem because I don't want to
have this new problem be causing the original.

In my tcp_sent callback, I see that I have no remaining data to send.  It
was recommended that this is the time that I can deallocate the memory
passed to tcp_write (because presumably it's been sent).  The problem is,
this data is still in the send queue and cannot be deallocated at this time.
The data cannot be deallocated until it is ACKed, which I have no way of
knowing (I think).

This makes me wonder, how is anyone handling calling tcp_write with
dynamically allocated memory and freeing it at the time when it is safe to?

Do I really need a custom version that tracks segments that have dynamic
memory, sees the ACK and then frees those that are marked dynamic?  Or as
I've done in the past, have I made this a much bigger problem than is really
there?

Thank you,
Bill

> -----Original Message-----
> I can only assume that your subsequent tcp_writes are not matching the
> 'if'
> condition. Maybe you could debug it (or add a little print statement) to
> find out why. It is possible there may be a bug around.
> 
> Jifl
> --
> eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
>  **  Visit us at ESC Silicon Valley <http://www.embedded.com/esc/sv>  **
>  **  April 15-17 2008, Booth 3012, San Jose McEnery Convention Center **
> Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
> Registered in England and Wales: Reg No 4422071.
> ------["Si fractum non sit, noli id reficere"]------       Opinions==mine
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]