It looks like you're new here. If you want to get involved, click one of these buttons!
local isServer = false local port = 5885 local function __getIP() local s = socket.udp() s:setpeername("66.147.244.100",80) local ip, _ = s:getsockname() s:close() return ip end listen = socket.udp() listen:setsockname(__getIP(),port) listen:settimeout(0) stage:addEventListener(Event.ENTER_FRAME, function() if isServer then listen:setoption('broadcast', true) assert(listen:sendto("hello", "255.255.255.255", port)) listen:setoption('broadcast', false) else repeat local data, ip, port = listen:receivefrom() if data then print(data, ip, port) end until not data end end ) |
Comments
http://appcodingeasy.com/Gideros-Mobile/Using-LuaSocket-in-Gideros
And it worked. You can check Draw together example here:
http://appcodingeasy.com/Gideros-Mobile/Gideros-Unite-framework-for-multiplayer-games