lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] tcp_close and the unsent queue


From: Kieran Mansley
Subject: Re: [lwip-users] tcp_close and the unsent queue
Date: Tue, 10 Oct 2006 19:25:33 +0100
User-agent: Mutt/1.5.11

On Tue, Oct 10, 2006 at 12:53:12PM -0400, Tom Hennen wrote:
> If I ignore this best practice and just call tcp_close when I receive
> a close request from another host then any packets left on the unsent
> queue end up 'leaking'.
> 
> Is there any particular reason tcp_close doesn't free the unsent queue
> when closing the connection?
> 
> Is there any other side-effect to calling tcp_close before unacked and
> unsent are NULL?

I don't have the source to hand to check that you're right about the
best way to use tcp_close(), but it sounds plausible.  The reason, I
expect, for waiting (and so the side effect of not waiting) for the
unacked and unsent to be NULL is to ensure that all the data you have
requested be sent to the other side have in fact been sent and
successfully received.  If packets get leaked, this means they haven't
yet been sent or acknowledged, and so you risk data loss.

Kieran




reply via email to

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