Bug 140

Summary: NodeList::Connect vs TraceConnect for each node: bug?
Product: ns-3 Reporter: Gustavo J. A. M. Carneiro <gjcarneiro>
Component: coreAssignee: ns-bugs <ns-bugs>
Status: RESOLVED INVALID    
Severity: normal    
Priority: P3    
Version: pre-release   
Hardware: All   
OS: All   

Description Gustavo J. A. M. Carneiro 2008-02-15 11:08:31 UTC
Please tell me if I am doing something wrong:

  for (NodeList::Iterator iter = NodeList::Begin ();
       iter != NodeList::End (); iter++)
    {
      Ptr<BenchNode> node = dynamic_cast<BenchNode*> (PeekPointer<Node> (*iter));
      node->TraceConnect ("/devices/*/queue/dequeue", MakeCallback (&MonitorNeighbors));
    }

In this case, the MonitorNeighbor trace function gets called, but only for node 0, not for any other node.  Changing to this line at the end of the for loop fixes the problem for me:

  NodeList::Connect ("/nodes/*/devices/*/queue/dequeue", MakeCallback (&MonitorNeighbors));

But I thought they were supposed to be equivalent?  Am I misunderstanding the API, or have I found a bug?
Comment 1 Gustavo J. A. M. Carneiro 2008-02-26 10:16:19 UTC
I'm unable to reproduce this problem anymore, even using the same test case.  Not sure what happened.  I'll reopen if I can reproduce again.