--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/W-kJ3sY2yToJ.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
I think that the packet can be read by this method but i am not sure.uint8_t *buffer = new uint8_t[packet->GetSize()];pk->CopyData (buffer, packetk->GetSize());string data = string((char*)buffer);Good luck
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/x2DrwWh684wJ.
sorry for my error.At sender, you can create a packet by this way.stringstream msgx;msgx << " abcdefg or your data " ;uint16_t packetSize = 800;Ptr<Packet> packet = Create<Packet>((uint8_t*) msgx.str().c_str(), packetSize);
At receiver, you can read the data by this way
uint8_t *buffer = new uint8_t[packet->GetSize()];packet->CopyData (buffer, packet->GetSize());string data = string((char*)buffer);I hope it works.Regards
A low-level Socket API based loosely on the BSD Socket API.
A few things to keep in mind about this type of socket:
Other than that, it tries to stick to the BSD API to make it easier for those who know the BSD API to use this API. More details are provided in the ns-3 tutorial.
I do not know it too but I guess that you do not make call a call back in your simulation.
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/MuZhSUkI8x0J.