UDP - Listening for the server

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?

Can you post the error message?

IF you have one.

If you dig through this you can see a socket loop using Corona.

https://github.com/develephant/Coronium-GS-Client/blob/master/lua/gs/CoroniumGSClient.lua

I managed to get my original Lua script running in corona with help of the below post:

https://forums.coronalabs.com/topic/63755-issues-with-socket-library-after-updating-corona-enterprise/

Ended up using 

listen = socket.udp4() 

instead of

listen = socket.udp() 

Can you post the error message?

IF you have one.

If you dig through this you can see a socket loop using Corona.

https://github.com/develephant/Coronium-GS-Client/blob/master/lua/gs/CoroniumGSClient.lua

I managed to get my original Lua script running in corona with help of the below post:

https://forums.coronalabs.com/topic/63755-issues-with-socket-library-after-updating-corona-enterprise/

Ended up using 

listen = socket.udp4() 

instead of

listen = socket.udp()