[Ns-bugs] [Bug 281] Socket::CreateSocket (node, "string") does not do what you think

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Thu Aug 14 08:28:10 PDT 2008


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





------- Comment #3 from mathieu.lacage at sophia.inria.fr  2008-08-14 11:28 -------
(In reply to comment #2)
> Created an attachment (id=228)
 --> (http://www.nsnam.org/bugzilla/attachment.cgi?id=228&action=view) [details]
> Testcase and fix in one
> 
> I changed the PacketSink call to Socket::CreateSocket to pass the correct const
> char* instead of a TypeId (this is the test case).
> 
> The fix is the explicit keyword.  As you will see, the compiler doesn't do the
> implicit conversion from const char* using the offending TypeId constructor any
> longer, and it won't compile this kind of code instead of subtly failing at
> runtime:
> 
> ../src/applications/packet-sink/packet-sink.cc:88: error: no matching function
> for call to 'ns3::Socket::CreateSocket(ns3::Ptr<ns3::Node>, const char*)'
> debug/ns3/socket.h:94: note: candidates are: static ns3::Ptr<ns3::Socket>
> ns3::Socket::CreateSocket(ns3::Ptr<ns3::Node>, ns3::TypeId)
> 
> Mathieu, comments?

if it works, I am all for it. Please, apply.


-- 
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