[Ns-bugs] [Bug 244] PacketSink is not multitasking

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Fri Jul 11 11:46:44 PDT 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=244





------- Comment #11 from raj.b at gatech.edu  2008-07-11 14:46 -------
The following is a snippet that verifies that the forked sockets upcall to
HandleRead correctly already, and I verified this is due to the compiler
generated (POD) copy constructors copying the socket base class callbacks.

@@ -102,6 +108,21 @@ void PacketSink::StopApplication()     /

 void PacketSink::HandleRead (Ptr<Socket> socket)
 {
+  if(socket != m_socket)
+    {
+      std::cout<<"HandleRead got an upcall from a forked socket"<<std::endl;
+      std::list<Ptr<Socket> >::iterator i = m_socketList.begin();
+      bool iOwnThisSocket = false;
+      while(i != m_socketList.end())
+        {
+          if (*i == socket)
+            {
+              iOwnThisSocket = true;
+            }
+          ++i;
+        }
+      NS_ASSERT(iOwnThisSocket);
+    }
   Ptr<Packet> packet;
   Address from;
   while (packet = socket->RecvFrom (from))


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list