lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [task #10088] Correctly implement close() vs. shutdown()


From: Simon Goldschmidt
Subject: [lwip-devel] [task #10088] Correctly implement close() vs. shutdown()
Date: Mon, 15 Feb 2010 19:40:18 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2) Gecko/20100115 Firefox/3.6

Follow-up Comment #2, task #10088 (project lwip):

In buf #26062, we talked about the FIN_WAIT_2 timer and Jeff said that just
changing the timer mechanism in that state wouldn't be enough.

The current assumption was that what we are currently having with tcp_close()
rather was a shutdown actually - that is, a shutdown(SHUT_WR), meaning closing
our write-side and leaving open our read-side of the connection.

Thinking about this, Jeff's idea might be true and a flag "receive closed"
might be enough:
- shutdown(SHUT_RD) can set the flag -> no more incoming data is passed to
the application; pcb->tmr is not reset by incoming segments
- shutdown(SHUT_WR) is like now: send FIN but still process incoming segments
and pass them to the application (forever?)
- shutdown(SHUT_RDWR) is both: sedn FIN and stop accepting incoming segments
-> since pcb->tmr is not reset any more, FIN_WAIT_2 will time out eventually
if the remote side doesn't respond with FIN in time

This is under the assumption that shutdown(SHUT_RDWR) == close(), I hope
that's correct.

I'd have to take a closer look at when pcb->tmr is reset for incoming
segments, but other than that, I'm pretty sure this should work.


Another problem has been mentioned by Jeff, too: what about applications that
call tcp_close() and realy on receiving the remote FIN (p==NULL in recv
callback)? If we implemented a 'real' close, this would no longer be the case.
I do think that's OK for an update from 1.3.x to 1.4.0, but there might be
other possibilities...

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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