autoLan - pongDemo3

Ed,

Thats fine…  you have done plenty to help.   I did play a little with the UDP(roll my own) stuff… and sort-of-understand some of it.  Ran into a few snags doing that, and thought auto lan would be easier and quicker… since it actually worked well in the pong demo and in my app - 'to a point; just can’t have some devices not being able to host and such.  

I am going to table the local network stuff for now. 

Maybe somewhere down the road, there will be a corona plugin to handle local-network play. That might be helpful.

Have a great day!

Bob

Hi again.  I looked into this a bit and it works find for me (as long as I use my code).

  1. Did you read this: https://github.com/roaminggamer/AutoLan-IPv6/blob/master/README.md

  2. If not, in a nutshell there are a couple of variants of the IPV6 soulution.

  • Pong  Demo  3 - This uses Scott’s solution.
  • Pong Demo - This uses my solution mashed together with Scotts.
  • Why is there no 2?  I don’t know.

Pong Demo works fine for me between two simulator instances on the same Windows 10 machine.

You should try this example and if it works in your various cases, you should be good to go.

Be sure to ALSO read the top part of Client.lua and Server.lua as you may need to configure the files for you usage.  i.e. Don’t use these blindly.

Note: I’m also  99.999% sure you don’t need the IPV6 part of this fix for Local networking. 

I believe Pong Demo 3 is IPV6 ONLY which is probably why it isn’t working locally.  

This is stretching my memory a bit, but I believe Pong Demo (using my mashed up code) detects and uses IPV4 if that is all that is available.

My memory is very tenuous on this.

Ed,

Thanks.  I will give it one more try, and look over what you noted in your last 2 posts. I will let you know how it goes.  It may be late tomorrow before I can test it all, but I will do that tomorrow afternoon.

Thanks

Ed, 

Just  an update for you. The pong demo (I guess we can call that version 1), as you thought, works well on the simulator-ipad2-iphone6splus; they each are able to host and join any of the others. That is good.

The Android is able to host with any of the other devices including the simulator, but can not ‘join’ to any of them.  I figure this must be in the build.settings where there is only the permission :

“android.permission.INTERNET”,

Looking around the forum and internet… so far in all the posts I read about auto lan, I have seen nothing specific about the build.settings permissions for android,  so I am going thru the client.lua module of the pongDemo1.

I will let you know if I find anything there that may correct this last hurdle to getting this auto lan working, with host and join,on all the devices.

But, like I said, don’t waste any of your time on it … If I can’t find anything in the client.lua, I will scratch that feature from my app… not a big deal.

Thanks

Bob

Bob - I don’t have anything on that right now, but I should be reviewing Autolan for one of my own projects soon so I’ll post back when I figure out what’s going on with Android.

It could be a few days.

Ed,

Just an update… (I know it may be a few days before you have time to play with that pong demo again).

But, thus far, using some troubleshooting print statements and such, I have narrowed problem down to the call in the  Client.lua … in this function :

local function UDPBroadcastListen() if(broadcastListener) then local broadcastMessage, serverIP, serverPort -- when device is apple or simulator, returns table for broadcastMessage -- and host device ip for serverIP, as it should -- on android (armv7 / arm neon) it returns nil for boradcastMessage and -- 'timeout' as the serverIP ... not sure if the armv7 has anything to do with that broadcastMessage,serverIP,serverPort = broadcastListener:receivefrom()

I am somewhat stuck here as I have no experience with the socket stuff.  I will keep at it, but thought this little bit of info may jog something in your vast experience with this auto lan and socket stuff.  

Since the android can host, (it just fails to join) I would guess the armv7 has little to do with this problem.

Thanks 

Bob