hhromic / libe131

libE131: a lightweight C/C++ library for the E1.31 (sACN) protocol
Apache License 2.0
76 stars 19 forks source link

Add being able to bind a multicast socket to a specific host IP #13

Closed opsnlops closed 5 months ago

opsnlops commented 5 months ago

Hello!

This change allows for the user to specify an IP address on the host to bind to, rather than an interface index. I've found this to be helpful when working on a dual stack host.

An example of how this can be used:

if (e131_multicast_join_ifaddr(sockfd, 1, "1.2.3.4") < 0) {
    err(EXIT_FAILURE, "e131_multicast_join_ifaddr");
}

I've found working with the expected IP to bind to be easier to work with than the interface number for my projects.

Thanks for making this great library! I use it a lot!