lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Handle received data only partial


From: Simon Goldschmidt
Subject: Re: [lwip-users] Handle received data only partial
Date: Wed, 13 Sep 2017 07:13:25 +0200

Paul Plankton wrote:
> So when I do not want the window to be enlarged, I call this function not 
> with the amount of data received but with a fixed value? E.g. with the window 
> size like it is defined in lwipots.h?

I'm not sure I understand your question.

For a working TCP connection, you'll have to call 'tcp_recved()' eventually. 
The amount of bytes (coutn value) you pass to this function has to be the exact 
length of the received data or things will go wrong at some point.

Now you have the option to throttle the sender by only sending a full window of 
data until you are ready to process more data (in your application, the stack 
internals tell the remote host they have processed the data by sending an ACK, 
no a window update).

This is done by *not* calling 'tcp_recved()' directly from the recv callback 
but at a later point (watch out for threading issues here!).

However, you *always* must keep the byte count correct, you cannot just pass in 
any constant value!


Simon



reply via email to

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