Sepulchre49 / instant-messenger

An instant messenger application built in Java
0 stars 5 forks source link

StreamCorruptionException: Invalid type code: FF in Client.logout() #19

Closed Sepulchre49 closed 2 months ago

Sepulchre49 commented 2 months ago

Since we've updated the client to have inbound and outbound messaging threads, the client is now throwing a StreamCorruptionException on line 123 of Client.java during the call to read.readObject(). This may be caused by the stream reaching end of file, corrupted data, reading from the wrong position, or any other issues that could cause the ObjectInputStream to reach an inconsistent state.

It does not cause any major issues atm, but would like to find the cause and fix so we can ensure a consistent state for the client streams. I tried synchronizing all access to the read stream in the InQueue and Client class, to no avail. The server side seems to be sending the correct logout message.