[Ns-bugs] [Bug 424] TCP FIN notification callback needed

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Wed Mar 18 06:32:22 PDT 2009


http://www.nsnam.org/bugzilla/show_bug.cgi?id=424


Tom Henderson <tomh at tomh.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tomh at tomh.org




--- Comment #3 from Tom Henderson <tomh at tomh.org>  2009-03-18 09:32:22 EDT ---
(In reply to comment #1)
> http://code.nsnam.org/raj/ns-3-tcp/rev/83ccf9c5afa8
> 
> Does this do the trick?
> 

I do not think the implementation of this yields desired semantics.  I think we
want to be able to provide a signal that the application has read through the
received data up to a received FIN segment.

from man 3 recv:

"Upon successful completion, recv() shall return the length of the message in
bytes. If no messages are available to be received and the peer has performed
an orderly shutdown, recv() shall return 0. Otherwise, -1 shall be returned and
errno set to indicate the error. "

If you call this when the FIN is received, but you do not first make sure that
the application has read all of the locally received data, it is not equivalent
to a recv() that returns 0.  FIN may also be received out of order.

So, if we agree that we want to support the above recv() semantics (it is not
clear from the initial bug report), I would suggest to change it and change the
doxygen to say that it is supposed to align with the case that a synchronous
socket read() returns zero.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Ns-bugs mailing list