On Fri, 2011-05-13 at 10:36 +0200, Enrico Murador - Research &
Development - CET wrote:
> The question is: if I leave some data unread when exiting the receive 
> callback, when I should suppose the receive callback
> will be called again? Do I have to wait another TCP packet (or event) 
> sent from the network interface?

The callback won't be called again until there is new data, and the data
passed to the callback will only be the new data; it won't (I think)
pass you the data you've been given already as you were hoping.  I'm
afraid you have to create a list of the data you're interested in until
you've got enough to process.  You don't need to copy it, as this is the
point of tcp_recved() - it allows you to keep hold of the data until
you've finished with them, even if that's not straight away during the
callback.  Once you've processed and finished with the data, call
tcp_recved() and the stack will be allowed to reuse those buffers.

Kieran


_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to