-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No UDP received from Server to Client on Android > 5.0 #106
Comments
It's still read, it's just I don't usually have time to setup and debug on On Thu, Sep 3, 2015 at 11:28 PM, codeflakes0 notifications@github.com
|
Thank you for your answer Nathan. I've since checked as stated on the Google code forum that read() works and receive() returns null on android 5.0. I'm not familiar with the socket API and kryonet source code. Can I just use read() instead of receive() in readFromAdress() of UdpConnnection.java ? |
The following patch seems to work on my test app.
|
codeflakes0, thank you SO MUCH! I've wasted 2 days trying to get this issue down, and finally. |
How do i use this fix in gradle? I can't figure out how to download the latest commit by anubiann00b as jar repository. |
Just clone it and do |
I have installed maven and cloned the patched kronet version to my local maven repo and added mavenLocal() and compile "com.esotericsoftware:kryonet:2.22.0-RC1" to my build.gradle.. |
Just make sure to have
|
Yes, i have done it like that. So why isn't my Android 5 device receiving any udp messages? compile ("com.esotericsoftware:kryonet:2.22.0-RC1") {
exclude module : 'kryo'
}
compile "com.esotericsoftware:kryo:3.0.1" This is how my compile looks like. I had to exclude kryo from kryonet and complie it seperately because if i only compile |
Thanks also codeflakes0! Saved a lot of headache, and working for me on my newer Android devices now. Just switched to using UDP and TCP, and of course doesn't work on any but the oldest Android, but I was lucky to find this post. Now if only I could figure out how to get UDP to register not based on initial IP... (when connecting from an external IP, it first gets the first message from the router IP, than the internal IP, so kryo discards every message after that because they aren't from a registered IP) :/ |
Thanks a lot @codeflakes0 , and the team for making this great project! This makes it work, however after implementing this fix I have an issue with connections taking a long time to establish, and I get a lot of warnings that look like this:
The java.nio.SelectorImpl warning greatly outnumber the others. Any chance anyone else has faced this issue and come up with a solution? |
The project itself wasn't updated for more than two years – have you tried using one of the newer forks? |
You're right. No, I haven't, and since everything works with this one and I'm running my project on many different platforms and setups I was hoping I could stick with what I got implemented. Would you be able to recommend one though? |
There are three main forks:
|
FYI I've been testing on different platforms, and the issue seems to have been resolved starting from Android 7.0, API 24. The patch that I have seen implemented for this issue (the one proposed by @codeflakes0 here) for me at least caused the time spent connecting to increase tremendously, which made my app look like it wasn't working. |
If anyone is looking for a code base without the fix, my fork allows you to disable it by setting |
I'm not sure the google group is still read so I'm reposting the issue here.
Please see this post "https://groups.google.com/forum/#!topic/kryonet-users/7l436tftBlo" for details.
Basically with the simplest Client / Server application you can't send UDP from Server
to Client on Android > 5.0. The same code works on Android 4.4.
UDP sending from Client to Server works though ...
PS: I've tested it on localhost so with Client and Server on the same device but this should not be a problem and the same code works on 4.4.
The text was updated successfully, but these errors were encountered: