java.io.StreamCorruptedException: invalid type code: 00

后端 未结 6 1813
天命终不由人
天命终不由人 2020-11-27 08:43

So basically im writing a client-server multiplayer game. I have a SeverCommunicationThread that creates a gameThread if he receives a RequestForGame creates a gameThread.

6条回答
  •  情书的邮戳
    2020-11-27 09:15

    This problem can happen if you

    • construct a new ObjectInputStream or ObjectOutputStream over the same socket instead of using the same ones for the life of the socket;
    • use another kind of stream over the same socket as well; or,
    • use the object streams to read or write something that isn't an object and you get out of sync.

提交回复
热议问题