yasin1913 / kryonet

Automatically exported from code.google.com/p/kryonet
0 stars 0 forks source link

TCP timeout when using 3g #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.connect the android phone client to a server with default tcp keep 
alive/timeout not changed
2. use wifi, you will see no disconnects
3. switch to 3g, and you'll see every 12 seconds there is a disconnect

What is the expected output? What do you see instead?
3g should not disconnect every 12 seconds, as my connection is just fine.

What version of the product are you using? On what operating system?
1.04

Please provide any additional information below.
Although the cellphone's 3g connection isn't as stable as wifi, it is pretty 
stable for all the programs I use.  Definitely shouldn't be considered timing 
out every 12 seconds, as set in the client/server .setTimeout() method.

When using wifi for the client, it works perfectly...

Original issue reported on code.google.com by nep...@gmail.com on 12 Jul 2011 at 10:12

GoogleCodeExporter commented 8 years ago
Sorry for the delay. I need to get around to writing a test and seeing this for 
myself.

Original comment by nathan.s...@gmail.com on 26 Jul 2011 at 6:38

GoogleCodeExporter commented 8 years ago
Appreciate the time everyone involved put into this!  You could see the logs.

Download the app https://market.android.com/details?id=org.lucius.antm

And tail logcat with the tag "edz" while running the app with wifi, the switch 
to 3g and you will notice connection instability every several.seconds.  

Original comment by nep...@gmail.com on 26 Jul 2011 at 6:49

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Removed my comment as i figured out what causes it for me. I'm trying to send a 
compressed png over the network to my phone, if i comment that out it doesn't 
disconnect. If i keep the code in, it disconnects and never receives the packet 
at all. I'm guessing it has something to do with the amount of data being sent 
over the network.

Original comment by johan.f....@gmail.com on 28 Aug 2011 at 10:03

GoogleCodeExporter commented 8 years ago
Probably the buffer overflows because the network hardware buffer can't be 
emptied fast enough. Do you have an exception and stacktrace? KryoNet v2 has 
TcpIdleSender and InputStreamSender which can be used to send streams of data 
without huge buffer sizes.

Original comment by nathan.s...@gmail.com on 26 Apr 2012 at 3:31