CreateObject InetSocketAddress error, no member named Unref

333 views
Skip to first unread message

Jelline

unread,
Feb 25, 2014, 11:58:44 AM2/25/14
to ns-3-...@googlegroups.com
Dear Sir/Madam,

Have a nice day.

I use"CreateObject<InetSocketAddress>" to create serval InetSocketAddress pointers as member variables. But it reports the fllowing error.

./ns3/ptr.h: In destructor ‘ns3::Ptr<T>::~Ptr() [with T = ns3::InetSocketAddress]’:
./ns3/ptr.h:456:7: error: ‘class ns3::InetSocketAddress’ has no member named ‘Unref’

The related source code are:
Ptr<InetSocketAddress> alice;
 alice = CreateObject<InetSocketAddress> ("10.1.1.2", 80);

Thanks for your help.

Best regards,
Jelline


Tommaso Pecorella

unread,
Feb 25, 2014, 2:01:51 PM2/25/14
to ns-3-...@googlegroups.com
Hi,

InetSocketAddress is not derived from "Object" or "ObjectBase", or "SimpleRefCount". As a consequence, you can not use CreateObject<InetSocketAddress> or Ptr<InetSocketAddress> alice.


Just use plain, old pointers. Or just use normal member variables.


Cheers,


T.

Qiankun Su

unread,
Feb 25, 2014, 5:37:48 PM2/25/14
to ns-3-...@googlegroups.com
Dear Tommaso,

It is so kind of you. Thank you very much.

All the best to you.
Jelline

--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/g4kgUdXmVUg/unsubscribe.
To unsubscribe from this group and all its topics, 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 http://groups.google.com/group/ns-3-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages