OpenLightingProject / libartnet

An Open Source implementation of the ArtNet protocol
https://www.openlighting.org/libartnet-main/
GNU Lesser General Public License v2.1
124 stars 56 forks source link

setsockopt() are after bind() #3

Open sl1200mk2 opened 10 years ago

sl1200mk2 commented 10 years ago

Hi, in network.c, setsockopt() are after bind() thus we do not benefit of the option before the bind(). for example if I set: if (setsockopt(sock, SOL_SOCKET, SOREUSEPORT, (char) &trueflag, // char for win32 sizeof(int)) == -1) { artnet_error("Failed to bind to socket %s", artnet_net_last_error()); artnet_net_close(sock); return ARTNET_ENET; } before the call to bind(), I'm able to talk to local node that also use 0.0.0.0:6454

nomis52 commented 10 years ago

You're right, please open a pull request with the fix.