lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] flow of lwip as a stream client


From: address@hidden
Subject: Re: [lwip-users] flow of lwip as a stream client
Date: Thu, 01 Mar 2012 19:32:01 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

mat henshall wrote:
I think you will also want to return ERR_MEM from your callback, if I understand the code correctly, the stack will buffer the data for you and then will try again on the next fasttmr will try delivering the data again to your application.

This way, when your circular buffer is full, the stack will buffer up the data, and the server will stop sending data until you have cleared your circular buffer and the window is updated.

That should be a fallback only, because until you accept that packet, all other packets received from the remote host (including possible retransmissions) will neither get ACKed nor buffered, which results in unnecessary traffic.

If you design your buffer size and TCP_WND correctly and call tcp_recved() when you actually process/free pbufs (not enqueue them in your buffer), there's no need to return ERR_MEM from the recv callback.

Simon



reply via email to

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