lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Partial read on receive callback


From: Kieran Mansley
Subject: Re: [lwip-users] Partial read on receive callback
Date: Fri, 13 May 2011 09:41:37 +0100

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




reply via email to

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