[Ns-bugs] [Bug 154] Attach sockets to nodes

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Fri Mar 28 03:15:01 PDT 2008


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





------- Comment #15 from gjcarneiro at gmail.com  2008-03-28 06:15 -------
(In reply to comment #13)
> Created an attachment (id=120)
 --> (http://www.nsnam.org/bugzilla/attachment.cgi?id=120&action=view) [edit]
> Proposed solution
> 
> To clarify to Gustavo:
> 
> The implementation is as follows:  Instead of having the creator of the
> UdpSocket (what you call the factory) maintain a reference to it and consuming
> an extra amount of memory, this approach effectively Ref's the socket one more
> time to account for the pointer that exists to the socket in the endpoint
> callbacks (Ipv4EndPoint::m_rxCallback and m_destroyCallback).  From a reference
> counting perspective, I contend this is the right thing to do anyway.
> 
> This fix, while somewhat orthogonal to the issue at hand, also happens to solve
> the problem.

That sounds like a good solution as well, although it has slightly different
semantics from what I proposed.  Under your solution, a reference is kept to
the socket as long as there is a (rx,tx,destroy) callback associated with the
socket.  That makes sense.  A socket with no callbacks and which goes out of
scope should just be freed, as it will not prevent anything from working.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list