How to read the content of a socket

49 views
Skip to first unread message

xiexi...@gmail.com

unread,
Jun 26, 2018, 9:10:20 AM6/26/18
to ns-3-users
I want to construct a scenario where two node communicate via broadcast. For example, A sends a socket containing information about its location to B, and B receives it through another socket.

However, when i use the following code to read the content of B's socket, it is null. And I doubt if there is any bug of NS3 itself.

Can anyone answer it?


send-packetv3.cc

Konstantinos

unread,
Jun 27, 2018, 9:06:54 AM6/27/18
to ns-3-users
Hi

Please refer to the tutorial, for example the wifi-simple-adhoc.cc 

The packet and generally everything would happen once you call the Run() which starts the actual simulation. So printing the packet before that would give you null
Message has been deleted

xiexi...@gmail.com

unread,
Jul 4, 2018, 7:16:25 AM7/4/18
to ns-3-users
Thanks a lot. Your advice do help. Following your advice,I get some content of  I also search other post, and i find the cause of it. https://groups.google.com/forum/#!searchin/ns-3-users/read$20the$20content%7Csort:date/ns-3-users/khZyUoBzxDQ/58PWHkfJAAAJ

在 2018年6月27日星期三 UTC+8下午9:06:54,Konstantinos写道:
Reply all
Reply to author
Forward
0 new messages