[Ns-developers] Missing Socket::RecvFrom
George Riley
riley at ece.gatech.edu
Thu Jun 5 07:57:02 PDT 2008
On Jun 5, 2008, at 9:17 AM, Tom Henderson wrote:
> Gustavo Carneiro wrote:
>> What is now:
>> void
>> AgentImpl::RecvOlsr (Ptr<Socket> socket)
>> {
>> Ptr<Packet> receivedPacket;
>> receivedPacket = socket->Recv ();
>> SocketRxAddressTag tag;
>> bool found;
>> found = receivedPacket->FindFirstMatchingTag (tag);
>> NS_ASSERT (found);
>> Address sourceAddress = tag.GetAddress ();
>> Should be:
>> void
>> AgentImpl::RecvOlsr (Ptr<Socket> socket)
>> {
>> Address sourceAddress;
>> Ptr<Packet> receivedPacket;
>> receivedPacket = socket->RecvFrom (sourceAddress);
>> Much simpler, no?
>> I really don't understand why we are forcing our developers to
>> resort to an
>> ugly and custom NS-3 API for something which standard BSD sockets
>> already
>> have a vastly simpler API... I don't care if tags are used
>> underneath, but
>> it's not good idea to force tags on developers IMHO.
>> Shall I submit a patch to add the missing API?
>
> I support that; it would align with the SendTo() call already
> supported.
+1
George
>
>
> Thanks,
> Tom
More information about the Ns-developers
mailing list