I can't get an external internet client to connect to the host. I think I've done port forwarding correctly. I've determined my local IP (192.168.x.x) and port expected by the game and set that up in my router IP address for TCP and UDP. I could have got that wrong but I've checked every single option in the router admin window and exhausted all windows/options so I'm going to assume I got that bit right.
For the code - it works on LAN very well. A client can connect to 192.168.x.x with the required port and that works very well. sock.lua is fantastic this way. I just can't get an external host to connect. I use WHATISMYIP to get something like 526.154.x.x and give that to the client. Frustratingly, sock.lua gives no error message.
Here is the hosting code:
Code: Select all
server = Sock.newServer("*", 22122)
Code: Select all
server = Sock.newServer("0.0.0.0", 22122)
This is the client code:
Code: Select all
client = Sock.newClient(GAME_SETTINGS.hostIP, tonumber(GAME_SETTINGS.hostPort))
I feel I am --> <-- this far away from publishing my game so kinda jumping out of my skin to crack this one.