ApplicationContainer serverApp = server.Install (staWifiNode);//I have actually run a simulation with this script, so the application should be good.
Ptr<OnOffApplication> app = serverApp.Get(0);
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/6b58b61b-f8cb-42dc-ac8e-566da3eb82b8%40googlegroups.com.
error: invalid conversion from ‘ns3::Application*’ to ‘ns3::OnOffApplication*’
Hello,Would the following work for you?Ptr<OnOffApplication> app = serverApp.Get(0);Ptr<Socket> socketA = app->GetSocket();
ThanksVishaka
On Fri, Apr 17, 2020 at 6:58 PM yitao xing <ytxi...@gmail.com> wrote:
--I notice that there is a GetSocket() in OnOffApplicatioin class, but there is not something like this in OnOffApplicationHelper.I am trying to trace the cwnd in the socket that the helper create and install, so after
ApplicationContainer serverApp = server.Install (staWifiNode);//I have actually run a simulation with this script, so the application should be good.I use
Ptr<OnOffApplication> app = serverApp.Get(0);but get error info: error: invalid conversion from ‘ns3::Application*’ to ‘ns3::OnOffApplication*’ [-fpermissive]But when I successfully get applicatioin ptr like Ptr<Application> app = serverApp.Get(0);I dont know how to get to the GetSocket() function availiable in OnOffApplication.HELP ANYONE HELP PLZ:(
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-...@googlegroups.com.
// Use Downcasting for your purpose
Ptr<OnOffApplication
> app = DynamicCast <OnOffApplication
> (serverApp.Get(0)
);
// Then access the socket
Ptr<Socket> socket = app->GetSocket();