kryonet icon indicating copy to clipboard operation
kryonet copied to clipboard

The client can't find the the server by using "discoverHost" in Android

Open daojudada opened this issue 10 years ago • 1 comments

Excuse me, I hava a problem for your kryonet.
In my Application,a phone can't find the server which be create by other phone,when the two phone connect to the same WiFi.so i check your code,Then i find the client only send the broadcast package with the ip adddress "255.255.255.0" and "255.255.0.0".
so,why do the client broadcast with the "255.255.255.255",i change your code to that:

InetAddress targetAddr = InetAddress.getByName("255.255.255.255"); try { socket.send(new DatagramPacket(data, data.length, targetAddr, udpPort)); } catch (Exception ignored) { }

Then the client can find the server.So my problem is why won't do that?
sorry for my poor english :-)

daojudada avatar Apr 08 '15 14:04 daojudada

Hey, I'm having the same problem. I found this old community fix which seems to have solved the problem (I haven't tried it personally yet). I wonder if it was ever implemented ? https://groups.google.com/forum/#!topic/kryonet-users/UO8B9jzV5Bo

adnanhz avatar Nov 17 '15 10:11 adnanhz