This seems to be reporting the devices loopback address instead of it’s local subnet ip address? Is anyone else seeing this?
are you checking this on the server or the client?
I’m checking this before setting up a network as I’m using a separate thread with sockets to send the ip address over the broadcast address to potential listening servers. Basically, if the Android is the server nothing can connect to it because it spits the loopback address back out instead of its ip address on the network. My clients end up attempting to connect to themselves … or so it appears.
BTW, I’m doing this because Unity 2 networking didn’t seem to like broadcast packets.
unity networking exposes informations only when known and the network adress actually is not known without the server on the other side.
also I don’t see why you would need it cause if you fire out a udp broadcast it will contain information on who sent it in the data you get on the other side for example so the other side will know who you are and thats all thats required for them to contact you (aside of the port given you do a specific one).
that is within the lan
over the internet you will need to use unity networking anyway unless you want one with central servers as sockets won’t overcome the problems of nat passing … and on 3G or generally phone networks, don’t expect any phone to be able to act as server at all due to phone provider security measures, not even nat punchthrough will commonly work there.
I love doubling up on built in features That point you made right there should solve my problem. I noticed that my iPhone 4 exhibited the same behavior as the Android. My iPhone 3G spits out the correct ip address. There could be a number of issues causing this but it won’t matter if I can grab the ip off the UDP broadcast. Thanks!
you are a bit like me: “Why simple if there are at least 3 ways to first do it totally overcomplicated”