Closed orange451 closed 5 years ago
I know I am registering all the appropriate classes, as sometimes the application works without problem.
That is not necessarily true. If you send an object whose members variables can hold different types (depending on the situation), this could explain your issue.
Kryonet itself doesn't have any log output in this area so your only options are:
TcpConnection#readObject(Connection)
)/use the debugger (which is always a hassle dealing with networking)Thanks for the reply, @crykn All of the objects I am sending only contain Long and String fields.
I will look into logging the readobject method, thanks for the suggestion.
[Edit] I've updated to using a newer version of kryo. There's now debug output in the console. What appears to be happening is data is being sent before the client has registered their classes. Not quite sure how that is happening.
[Edit 2] I changed my code so that I register my classes before I attempt to establish a connection. I believe this has fixed it.
When I connect to my server using TCP from my client and start sending data, SOMETIMES I get this error:
Sometimes when I run the application it works with no problem. Sometimes I am met with this error. I am not quite sure why. I know I am registering all the appropriate classes, as sometimes the application works without problem. Are there any suggestions anyone can give to help debug this?