UDP Multicast with Julia

Hello,

I am using the following function to read UDP messages with Julia:

# background loop for receiving UDP messages, terminated with <ctrl> + <c>
function receiveData(server_ip)
	global terminate
	udpsock = UDPSocket()
	bind(udpsock, server_ip, port)
	i = 0
	try
		while true
			msg = String(copy(recv(udpsock)))
			enqueue!(q, msg)
		end
	catch my_exception
		if isa(my_exception, InterruptException)
			close(udpsock)
			terminate[1] = true
		end
	end
end

Now I want to receive multicast messages on the address 239.0.0.1. In C# this can be done by calling the method “JoinMulitcastGroup(adress)”. How can this be done in Julia?

I tried to use the function setopt as documented here:
http://docs.julialang.org/en/stable/stdlib/io-network/

but I am getting the error message:
ERROR: UndefVarError: setopt not defined

Is there a possibility to call a C function of the Linux standard library directly
to subscribe to a broadcast group?

Here is a nice example how to do it in C, maybe it is just stuffing the struct with correct values:

In fact it is an offtopic reply → multicast.

I should work on broadcast and multicast in the near future so please report your findings :slight_smile:.

Thanks for your hint!
But this still seams to be unresolved. I created an issue:
https://github.com/JuliaLang/julia/issues/21300

Uwe