Fix bug 168: Socket::SendTo does not return the number of bytes sent for udp sockets.
authorLiu Jian <liujatp@gmail.com>
Tue, 15 Apr 2008 09:41:58 -0700
changeset 2912 843e6218834f
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
--- a/src/internet-node/udp-socket.cc	Mon Apr 14 17:12:52 2008 -0700
+++ b/src/internet-node/udp-socket.cc	Tue Apr 15 09:41:58 2008 -0700
@@ -300,6 +300,7 @@
           NotifyDataSent (p->GetSize ());
         }
       NS_LOG_LOGIC ("Limited broadcast end.");
+      return p->GetSize();
     }
   else if (ipv4->GetIfIndexForDestination(dest, localIfIndex))
     {
@@ -307,7 +308,7 @@
       m_udp->Send (p, ipv4->GetAddress (localIfIndex), dest,
 		   m_endPoint->GetLocalPort (), port);
       NotifyDataSent (p->GetSize ());
-      return 0;
+      return p->GetSize();;
     }
   else
    {