[Ns-developers] DelayBox - ns-3
Matt Crinklaw
matt.crinklaw at gmail.com
Thu Apr 17 11:43:01 PDT 2008
> Application writers are not responsible for doing the connection. They
> just have to record their trace source in their TypeId in
> MyApplication::GetTypeId: the code in src/core/config.cc will take care
> of doing the connection for them.
>
So I defined my application, created a trace source, and added the
static GetTypeId function along with an accessor for the trace source.
But when I use Config to connect a callback to the trace source and
then run the program, my callback is never invoked.
There is nothing in the doxygen docs or tutorial about the Config
class yet. Anyhow, based on your previous email and the outdated docs
on tracing (http://www.nsnam.org/doxygen/group__tracing.html) I tried
connecting to my source with:
Config::Connect ("/NodeList/*/ApplicationList/*/TxPacket",
MakeBoundCallback (&TaggingSink, flowid));
where my source is indeed defined as TxPacket:
...
static TypeId tid = TypeId ("ns3::DelayBoxApplication")
.SetParent<Application> ()
.AddConstructor<DelayBoxApplication> ()
.AddTraceSource ("TxPacket", "generate and send a packet down to socket",
MakeTraceSourceAccessor (&DelayBoxApplication::m_txPacket))
;
...
but it doesn't give me any information nor does it attach the callback
to my source.
To get the obvious question out of the way, the source is being called
during program execution.
>
More information about the Ns-developers
mailing list