There are many examples for receiving multicast messages using a network interface (NIC, for example eth0, 127.0.0.1, etc.). However, a few discussions / examples on how to send multicast (UDP) messages to a specific interface, such as a local loop (127.0.0.1) instead of eth0 by default.
Reference: RedHat Linux, Python, 224.1.1.1 5005
Python Code Example in Python Multicast
Similar discussion for IPv6 How to send multicast packets through a dedicated interface in Linux
A similar discussion for Windows How to multicast (send) to the first network adapter?
Thanks in advance.
The question is what did you bundle How to multicast (send) to the first network adapter? mentions that you can use IP_MULTICAST_IF :
IP_MULTICAST_IF
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_IF, socket.inet_aton(addr))
Source: https://habr.com/ru/post/1401362/More articles:JAX-WS - NoSuchMethodError when receiving a message in a SOAP handler - javaJson array parameter using javascript - jsonSomething is blocking my memory, and the program freezes on GC.Collect () or GC.GetTotalAmountOfMemory (true) - garbage-collectionJquery gets the values โโof all test rows in a gridview table - javascriptFilter out part of an image using PIL, python - pythonUpload a single file using multiple threads - pythonHow to multicast (send) to the first network card? - cWhy should OutputStream be closed after entering android - javaHow to create a partial download in twisted? - pythonARC __bridge cast Block_copy & Block_release - iosAll Articles