[Ns-developers] ns3 - removal of Socket::HalfClose callbacks
Raj Bhattacharjea
raj.b at gatech.edu
Thu Mar 20 15:06:47 PDT 2008
The callback API for Socket objects is kind of strange. In
particular, there is a "halfClose" callback and a "closeRequested"
callback. Its clear from the Doxygen that it wasn't very well
understood when to invoke these callbacks...that is because only one
of them is required, the closeRequested callback, and it is invoked
precisely when in a connection, your peer requests a close (i.e. for
TCP when a FIN arrives on either end of the connection).
I propose the following patch as a fix:
http://code.nsnam.org/raj/ns-3-dev/rev/ee0139477951
It removes the notion of the halfClose and replaces it entirely with
closeRequested. It also separates the setter for this callback into a
method Socket::SetCloseRequestCallback, instead of lumping it with the
Socket::SetAcceptCallback. It also makes the appropriate changes to
code which uses the Socket callback APIs, namely the PacketSink
application and TCP example scripts.
--
Raj Bhattacharjea
Georgia Institute of Technology
School of Electrical and Computer Engineering
Systems Analyst
404.894.2955
More information about the Ns-developers
mailing list