title: How to send a reply to root node and at the same time a message to child nodes?
body: <p>In Omnet++, I have created a network in which a root node sent a message to child nodes. The child node sends an acknowledgment to the root node and sends another message to its child nodes but my code also sends the message to the root node. I want to prevent the new message from sending to the root node.
  The code for acknowledgment is:</p>
  <pre><code>cGate * sender = msg-&gt;getSenderGate();
              for (cModule::GateIterator i(this); !i.end(); i++)
              {
                   cGate *gate = i();
                   std::string gateStr = gate-&gt;getName();
                   if (gateStr == &quot;out&quot; &amp;&amp; gate-&gt;getPathEndGate()-&gt;getOwnerModule() == sender-&gt;getOwnerModule() )
                   {
                       int senderId = gate-&gt;getIndex();
                       cMessage *reply=new cMessage(&quot;reply&quot;);
                       send(reply, &quot;out&quot;, senderId);
                   }
  
              }
  </code></pre>
  <p>and the code for sending a new message to child nodes are:</p>
  <pre><code> for (int i = 0; i &lt; gateSize(&quot;out&quot;); i++) {
  
                                      cMessage *l2 = new cMessage (&quot;l2&quot;);
                                      send(l2, &quot;out&quot;, i);
              }
  </code></pre>