EsotericSoftware / kryonet

TCP/UDP client/server library for Java, based on Kryo
BSD 3-Clause "New" or "Revised" License
1.81k stars 416 forks source link

Client from Germany with IPv6 get disconnected after 2-5 minutes without stack error #102

Open ghost opened 8 years ago

ghost commented 8 years ago

Hello

I have a really strange problem

It only happens with clients from germany, they all told me they had a IPv6 connection using Wifi

Once they connect, after 2-5 minutes they get disconnected, there is no error at all

That's really strange, i use default kryonet settings, no tcp/udp timeout change at all

I'm sending both TCP and UDP packets, at a rate of ~5 packets/seconds per client, around 30 clients connected at same time

TCP:54555, UDP:54777

Right after they connect they get flagged as IDLE

        client.addListener(new Listener()
        {

            @Override
            public void idle(Connection connection)
            {
                super.idle(connection);
                System.out.println("DEBUG: WARN: IDLE!");
            }
        }

I have no idea why, and how to fix that..

ghost commented 8 years ago

Is it because clients are only sending one packet for login, then they just have to receive packets from server

Do the client need to send a ACK packet to avoid being flagged as 'idle' ??

NathanSweet commented 8 years ago

KryoNet sends objects across the connection to keep it alive. I'm not sure why they would be disconnected.

On Wed, Jul 29, 2015 at 10:31 AM, Scellow notifications@github.com wrote:

Is it because clients are only sending one packet for login, then they just have to receive packets from server

Do the client need to send a ACK packet to avoid being flagged as 'idle' ??

— Reply to this email directly or view it on GitHub https://github.com/EsotericSoftware/kryonet/issues/102#issuecomment-125880370 .

brenoinojosa commented 8 years ago

I wonder if the keep alive is taking too long to get a response.

CreamyCookie commented 8 years ago

@Scellow Have you found the problem?

ghost commented 8 years ago

@CreamyCookie I don't really know how i fixed it exactly, but by changing the port (7776, 7777) and reduced the size of the packets, the problem disapeared