Cut over UDP applications to use the new receive API
This commit is contained in:
1 parent
d7a038431f
commit
288d193daa
12 files changed
+230
-23
No files matched your search
@@ -301,15 +301,30 @@ PacketSocket::ForwardUp (Ptr<NetDevice> device, Ptr<Packet> packet,
|
||||
address.SetSingleDevice (device->GetIfIndex ());
|
||||
address.SetProtocol (protocol);
|
||||
|
||||
SocketRxAddressTag tag;
|
||||
tag.SetAddress (address);
|
||||
packet->AddTag (tag);
|
||||
m_deliveryQueue.push (packet);
|
||||
NS_LOG_LOGIC ("UID is " << packet->GetUid() << " PacketSocket " << this);
|
||||
NotifyDataReceived (packet, address);
|
||||
NotifyDataRecv ();
|
||||
}
|
||||
|
||||
Ptr<Packet>
|
||||
PacketSocket::Recv (uint32_t maxSize, uint32_t flags)
|
||||
{
|
||||
if (m_deliveryQueue.empty() )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Ptr<Packet> p = m_deliveryQueue.front ();
|
||||
m_deliveryQueue.pop ();
|
||||
if (p->GetSize() <= maxSize)
|
||||
{
|
||||
m_deliveryQueue.pop ();
|
||||
}
|
||||
else
|
||||
{
|
||||
p = 0;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user