lwip-devel
[Top][All Lists]
Advanced

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

RE: [lwip-devel] Re: tcp_input: order of processing question/comment


From: bill
Subject: RE: [lwip-devel] Re: tcp_input: order of processing question/comment
Date: Wed, 4 Feb 2009 14:12:27 -0500

>It could also be an error from the tcp_sent callback. tcp_output is only
>called if everything succeeds. I suppose in an attempt not to propagate
>errors.

The receive callback, if called, overwrites any error set by the sent
callback.  I don't know if this is the intent.

>Is your receive callback returning errors?

Never.

>The tcp_recv callback is likely to call tcp_write with a reply to the
>data received. Calling tcp_output after the callback allows the ACK to
>piggyback on the reply. If you call tcp_output first, it may send an
>empty ACK segment only to be followed immediately by the reply.

This sounds reasonable.  One could then possibly expect lower throughput by
adding the call before, but this isn't what I see.  Maybe it's application
dependent.

>The same goes for the tcp_sent callback.

I think it's safe to assume that the sent callback will most often be
writing more data.  In many (most?) cases data is sent out because of data
received so I have to wonder if the receive callback should be called ahead
of the sent callback?  Oh, the sent callback is called when more data can be
accepted and maybe this has no relationship to the receive callback sending
anything.  Mostly I found it interesting that outbound bandwidth improved by
this change.

Thanks for everyone's comments.

Bill





reply via email to

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