Move other applications to RecvFrom ()
This commit is contained in:
@@ -103,14 +103,9 @@ void PacketSink::StopApplication() // Called at time specified by Stop
|
||||
void PacketSink::HandleRead (Ptr<Socket> socket)
|
||||
{
|
||||
Ptr<Packet> packet;
|
||||
while (packet = socket->Recv ())
|
||||
Address from;
|
||||
while (packet = socket->RecvFrom (from))
|
||||
{
|
||||
SocketAddressTag tag;
|
||||
bool found;
|
||||
found = packet->FindFirstMatchingTag (tag);
|
||||
NS_ASSERT (found);
|
||||
Address from = tag.GetAddress ();
|
||||
// XXX packet->RemoveTag (tag);
|
||||
if (InetSocketAddress::IsMatchingType (from))
|
||||
{
|
||||
InetSocketAddress address = InetSocketAddress::ConvertFrom (from);
|
||||
|
||||
@@ -154,14 +154,9 @@ UdpEchoClient::HandleRead (Ptr<Socket> socket)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << socket);
|
||||
Ptr<Packet> packet;
|
||||
while (packet = socket->Recv ())
|
||||
Address from;
|
||||
while (packet = socket->RecvFrom (from))
|
||||
{
|
||||
SocketAddressTag tag;
|
||||
bool found;
|
||||
found = packet->FindFirstMatchingTag (tag);
|
||||
NS_ASSERT (found);
|
||||
Address from = tag.GetAddress ();
|
||||
// XXX packet->RemoveTag (tag);
|
||||
if (InetSocketAddress::IsMatchingType (from))
|
||||
{
|
||||
InetSocketAddress address = InetSocketAddress::ConvertFrom (from);
|
||||
|
||||
@@ -95,14 +95,9 @@ void
|
||||
UdpEchoServer::HandleRead (Ptr<Socket> socket)
|
||||
{
|
||||
Ptr<Packet> packet;
|
||||
while (packet = socket->Recv ())
|
||||
Address from;
|
||||
while (packet = socket->RecvFrom (from))
|
||||
{
|
||||
SocketAddressTag tag;
|
||||
bool found;
|
||||
found = packet->FindFirstMatchingTag (tag);
|
||||
NS_ASSERT (found);
|
||||
Address from = tag.GetAddress ();
|
||||
// XXX packet->RemoveTag (tag);
|
||||
if (InetSocketAddress::IsMatchingType (from))
|
||||
{
|
||||
InetSocketAddress address = InetSocketAddress::ConvertFrom (from);
|
||||
|
||||
Reference in New Issue
Block a user