[Ns-bugs] [Bug 546] Empty pcap traces
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Fri Apr 17 09:12:01 PDT 2009
http://www.nsnam.org/bugzilla/show_bug.cgi?id=546
--- Comment #11 from Craig Dowell <craigdo at ee.washington.edu> 2009-04-17 12:12:01 EDT ---
The problem is a memory leak triggered by the lines you added in the echo
client application:
tid = TypeId::LookupByName ("ns3::Ipv4RawSocketFactory");
Ptr<Socket> s = Socket::CreateSocket (GetNode(), tid);
The destructor from the created raw socket is not called when s goes out of
scope. This leaves a reference to the node in the socket which causes the node
not to be destroyed, which in turn means that the pcap trace is not desroyed,
which means the trace file is not flushed and closed.
Right now the socket you create does nothing but cause a memory leak, so either
remove the lines of code above or add the following line of code to release the
socket:
s->Close ();
This begs the question of why the system is not destroying the socket when it
closes down.
--
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the Ns-bugs
mailing list