lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hello Diego and list:

I've been playing with multicast sockets under C and Lua.

I just noticed that under OSX, the socket option SO_REUSEADDR doesn't behave the same as Linux... that is I cannot open multiple listeners on the same multicast address (group).

A quickly banged-out fix was to change SO_REUSEADDR in luasocket/src/ options.c to SO_REUSEPORT. In my local C code, I use the __APPLE__ define to make this conditionally compile under both Linux and OSX.

I'll see if I can find out why OSX has this behavior, but in the meantime... this is a quick fix for me that I thought might help someone else out there!