How to call the TxWithAddresses callback function

28 views
Skip to first unread message

Yutaka.M

unread,
Jun 19, 2018, 6:29:28 AM6/19/18
to ns-3-users
Hi All,

I used a callback function in the way (1).
I also want an address when a new packet is created and is sent.
However, although it improved as (ii), it became impossible to call the callback function.

(i) Original source code
void PacketNumbers(std::string context, Ptr<const Packet> packet){}
Config::Connect("/NodeList/*/ApplicationList/*/$ns3::UdpEchoClient/Tx", MakeCallback(&PacketNumbers));

(ii) Source code that does not work
void PacketNumbers(std::string context, Ptr<const Packet> packet, const Address &destAddress)
Config::Connect("/NodeList/*/ApplicationList/*/$ns3::UdpEchoClient/TxHi All,

I used a callback function in the way (1).
I also want an address when a new packet is created and is sent.
However, although it improved as (ii), it became impossible to call the callback function.

(i) Original source code
void PacketNumbers(std::string context, Ptr<const Packet> packet){}
Config::Connect("/NodeList/*/ApplicationList/*/$ns3::UdpEchoClient/Tx", MakeCallback(&PacketNumbers));

(ii) Source code that does not work
void PacketNumbers(std::string context, Ptr<const Packet> packet, const Address &destAddress)
Config::Connect("/NodeList/*/ApplicationList/*/$ns3::UdpEchoClient/TxWithAddresses", MakeCallback(&PacketNumbers));

Please help me out.

Thanks
Yutaka.M", MakeCallback(&PacketNumbers));

Please help me out.

Thanks
Yutaka.M
Reply all
Reply to author
Forward
0 new messages