I have a server up and running that is sending out messages over a multicast IP address and port.
I’m trying to create a Corona client that simply reads these messages.
Using ZeroBrane Studio i have a Lua script that connects to the server using UDP and prints out everything the server is sending.
local socket = require"socket" local group = "226.192.1.1" local port = 9002 local c = (socket.udp()) print((c:setoption("reuseport", true))) print((c:setsockname("\*", port))) print((c:setoption("ip-add-membership", {multiaddr = group, interface = "\*"}))) while 1 do buf, ip, port = c:receivefrom() if buf then print("IP Address: ", buf) end
I’m try to create something similar in Corona but having no luck.
I’ve tried the example posted here: https://coronalabs.com/blog/2014/09/23/tutorial-local-multiplayer-with-udptcp/ but so far no luck in receiving anything from the server.
I’m currently running with the simulator on windows. Is the above possible with the corona simulator?