LuaSocket issues with servers

I’m trying to create the multiplayer portion of my game and to do so I need to set one device as a server and one as a client.

I’m using the LUBE lib (see: LUBE for explaination)

Basically what is does is start a udp/tcp (I’ve tried both) server on port 8080 (although I’ve tried dozens of other ports) that accepts all incoming connections.

If the simulator is the server all connections work great; if the device (I’ve tried several) is the server, nothing happens (regardless if it’s connected to the same network or using mobile data)

Any thoughts as to why it might do this; if it didn’t work at all I’d assume it was a bad server implementation, but because it’s only the device that does this it has be stumped

basic overview of my code (simplified a bit)
[lua]slither = require “slither”
require “LUBE”
server = {}

function server.load(port)
local s = lube.udpServer
s:init()
s.handshake = ‘digimongameclient’
s:setPing(true, 5, ‘pingo’)

s:listen(port)
s:accept()

function s.callbacks.connect(clientid)

return clientid
end

function s.callbacks.recv(data, clientid)

d = json.decode(data)

end

function s.callbacks.disconnect(clientid)

return clientid
end

function s.updateF()
s:update(0.01)
end
Runtime:addEventListener(‘enterFrame’, s.updateF)
return s
end


client = {}
function client.load(host,port)

local c = lube.udpClient
c:init()
c.handshake = ‘digimongameclient’
c:setPing(true, 5, ‘pingo’)

success, err = c:connect(host, port, true)
if success then
function c.callbacks.recv(data)

d = json.decode(data)

end

function c.updateF()
c:update(0.01)
end

Runtime:addEventListener(‘enterFrame’,c.updateF)
end

return c
end

–client.obj = client.load(host,port) —sets as client

–server.obj = server.load(port) —sets as server[/lua]
Any and all help will be greatly appreciated!!!

external libs:
LUBE
Slither [import]uid: 8838 topic_id: 26878 reply_id: 326878[/import]

Ok! I am not sure this will help you! But I had a similar problem with a game!

It was a real-time multiplayer game using UDP connections to transfer data. I used Auto Lan.

If both devices used 3G internet or Wifi everything worked great.

But with 2G internet

  1. if server has 2G and client is 3G - WORKS WELL
  2. if server has 3G and client is 2G - Unable to connect. I am unable to establish a basic UDP connection!
    What internet connections do ur device and simulator use? Maybe yours is a problem like mine and not a DEVICE-SIM problem;
    @Ansca Guys
    Is this scenerio due to some bug on Corona side???

[import]uid: 64174 topic_id: 26878 reply_id: 109109[/import]

I’ve been mostly using 3G (Although I’m in Australia on the Telstra network, which uses a 3.5/4G netowrk but same diff)
I’ll try testing through wifi and see if that fixes anything [import]uid: 8838 topic_id: 26878 reply_id: 109193[/import]