Fix bug 168: Socket::SendTo does not return the number of bytes sent for udp sockets.
authorLiu Jian <liujatp@gmail.com>
Tue Apr 15 09:41:58 2008 -0700 (22 months ago)
changeset 2912843e6218834f
parent 2911 7d6721a53b51
child 2913 66dd24c80d75
Fix bug 168: Socket::SendTo does not return the number of bytes sent for udp sockets.
src/internet-node/udp-socket.cc
     1.1 --- a/src/internet-node/udp-socket.cc	Mon Apr 14 17:12:52 2008 -0700
     1.2 +++ b/src/internet-node/udp-socket.cc	Tue Apr 15 09:41:58 2008 -0700
     1.3 @@ -300,6 +300,7 @@
     1.4            NotifyDataSent (p->GetSize ());
     1.5          }
     1.6        NS_LOG_LOGIC ("Limited broadcast end.");
     1.7 +      return p->GetSize();
     1.8      }
     1.9    else if (ipv4->GetIfIndexForDestination(dest, localIfIndex))
    1.10      {
    1.11 @@ -307,7 +308,7 @@
    1.12        m_udp->Send (p, ipv4->GetAddress (localIfIndex), dest,
    1.13  		   m_endPoint->GetLocalPort (), port);
    1.14        NotifyDataSent (p->GetSize ());
    1.15 -      return 0;
    1.16 +      return p->GetSize();;
    1.17      }
    1.18    else
    1.19     {