title: How to receive ip multicast, using only one NIC
body: <p>I have server with multiple NICs, running windows server 2003. My application receive multicast packets, but now i need to receive multicast packets just from one single network interface. I think this can help, but i have some questions.</p>
  
  <pre><code>ip_mreq   mreq;
  
  mreq.imr_multiaddr.s_addr = multicast group address
  mreq.imr_interface.s_addr=  network interface address
  if (setsockopt( socet
                , IPPROTO_IP
                , IP_ADD_MEMBERSHIP
                , (const void *)&amp;mreq
                , sizeof(mreq)) &lt; 0)
  {
     std::cerr &lt;&lt; "setsockopt error" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>First of all, what do i need to use as a network interface address? Local address of the network interface(same that ipconfig returns), or index of the network interface, that i can get using GetAdaptersAddresses api function?</p>
  
  <p>Second, is this actualy possible with windows, or i just spend my time?</p>
  
  <p><strong>Update</strong>
  I just read about WSAJoinLeaf function, and i wonder, that it is not possible to use only one NIC for multicasts.</p>