Anny Caroline
2018-12-05 00:02:56 UTC
Hi,
I'm devoloping an application following this tutorial:
https://www.nsnam.org/wiki/HOWTO_make_and_use_a_new_application
The application is called RequestResponseClient, and its based on
EchoServerClient.
I need to get the variable *m_sent* from my main application. So, I created
a public function called *GetPacketsSent *that should return this variable.
But, when I execute the main application (mainApplication.cc) I get a
Segmentation Fault.
A fun thing: If GetPacketsSent returns a number (for example, *return 1*)
everything works fine.
Function declared at RequestResponseClient.cc:
uint32_t
RequestResponseClient::GetPacketsSent (void)
{
NS_LOG_FUNCTION (this);
return m_sent;
} Function call at mainProgram.cc std::cout <<
filhos.Get(0)->GetObject<RequestResponseClient>()->GetPacketsSent() <<
std::endl;
------------------------------
HOWTO make and use a new application - Nsnam
<https://www.nsnam.org/wiki/HOWTO_make_and_use_a_new_application>
I'm devoloping an application following this tutorial:
https://www.nsnam.org/wiki/HOWTO_make_and_use_a_new_application
The application is called RequestResponseClient, and its based on
EchoServerClient.
I need to get the variable *m_sent* from my main application. So, I created
a public function called *GetPacketsSent *that should return this variable.
But, when I execute the main application (mainApplication.cc) I get a
Segmentation Fault.
A fun thing: If GetPacketsSent returns a number (for example, *return 1*)
everything works fine.
Function declared at RequestResponseClient.cc:
uint32_t
RequestResponseClient::GetPacketsSent (void)
{
NS_LOG_FUNCTION (this);
return m_sent;
} Function call at mainProgram.cc std::cout <<
filhos.Get(0)->GetObject<RequestResponseClient>()->GetPacketsSent() <<
std::endl;
------------------------------
HOWTO make and use a new application - Nsnam
<https://www.nsnam.org/wiki/HOWTO_make_and_use_a_new_application>
--
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 post to this group, send email to ns-3-***@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.
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 post to this group, send email to ns-3-***@googlegroups.com.
Visit this group at https://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/d/optout.