lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Closing a connection


From: K.J. Mansley
Subject: Re: [lwip-users] Closing a connection
Date: 14 Apr 2004 17:30:29 +0100

On Wed, 2004-04-14 at 17:42, Robert wrote:
> Does anyone know the proper/best way to close a connection which using the 
> "raw" interface?
> 
> In my application, I am using "heartbeat" messages to more quickly
> determine if packets continue to be able to be passed between client and
> server.  Once I detect that the hearbeats messages have stopped arriving,
> I issue a tcp_close();  I would expect that would cause the connection to
> be shutdown.  tcp_close() figures out that the connection is in the
> established state, and so then sends a TCP_FIN.  After a very long (15
> minutes?) delay, this finally results in a call to my err callback 
> routine, which cleans things up.
> 
> Is there a better/faster way?  Perhaps setting the state to syn_sent 
> before calling tcp_close() for example?

If the link has been broken between the client and server, you're
probably stuck with the wait.  Sounds like TCP is waiting to get an ACK
for the FIN from the other end, and is never receiving it. TCP goes to
great pains to ensure that data gets through and is very reluctant to
give up in a hurry.  This is, essentially, a property of the TCP
protocol, rather than the lwIP implementation of it or the API you're
using.

If that doesn't fit with what you're observing then let us know.

Kieran





reply via email to

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