Reputation: 8584
I noticed Kryonet sending/receiving an object I did not register to each connected member about every 5 seconds. It's probably just a couple byte and even for a couple thousand players would not up the server load much more then 1 kB/s but I need to know.
I remember I have read something about this when I was fiddling with Kryonet a view years ago but I cannot find that article anymore.
To be clear, on the received
override method in the Listener
. I start receiving packets that I did not register once a client joins the server. The amount of packets being send and received by the server increases linearly with the amount of clients connected to the server.
Upvotes: 0
Views: 328
Reputation: 8584
Like EJP mentioned in the commend already it is some form of ping to keep the connection open. Here is the theory to why this behaviour happens (Disclaimer: I have no extended knowledge on the subject, yet) .
A TCP or UDP connection can stay open indefinitely but if neither the client nor the server communicates there is no way of knowing if the client (or server) has been disconnected. The constant pinging between client and server is called a heartbeat in this question.
So as far as I understand the Kryonet server will send an empty object to the client and the client should answer back. If the server does not receive an answer for a certain amount of time (I believe 5 seconds by default) the connection will be closed and other clients can be notified.
Upvotes: 0