lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #10370] Raw API: Callback for received FIN to confirm


From: Iordan Neshev
Subject: [lwip-devel] [task #10370] Raw API: Callback for received FIN to confirm connection is closed
Date: Tue, 11 May 2010 16:59:16 +0000
User-agent: Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15 Version/10.00

Follow-up Comment #3, task #10370 (project lwip):

I think that this callback should always come up. How else would an
application know what happened with its close request?

I think that calling it with p == NULL is the best way to inform the
application that the link is closed or going to be closed, as it was a month
ago.

Generally (p==NULL) is enough for the application to know that the link is no
more usable.

The err argument could reveal more info on what is going on in case we need
to know. For example:

ERR_OK - peer ACKed our close request, the link can no longer carry data in
either direction. We should clean up and free the PCB (probably outside the
callback)

ERR_CLSD - the peer actively closes the connection (FIN), he has nothing more
to send to us (while we MAY be able to tell him "good bye" before we close the
connection on our side). He expects FIN+ACK from us (does he?).

ERR_ABRT - the peer sent us RST, he aborted the connection on its side. We
MUST not send him more data. The application might still be able to get some
data which was received before the RST was received.

Such behavior will let older applications work with lwip 1.4.0 with less
changes.

By the way, currently the callback is always called with err=ERR_OK.


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?10370>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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