Bug 140 - NodeList::Connect vs TraceConnect for each node: bug?
NodeList::Connect vs TraceConnect for each node: bug?
Status: RESOLVED INVALID
Product: ns-3
Classification: Unclassified
Component: core
pre-release
All All
: P3 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-15 11:08 UTC by Gustavo J. A. M. Carneiro
Modified: 2008-02-26 10:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.