ObjectInputStream/ObjectOutputStream work not right

后端 未结 3 2074
轻奢々
轻奢々 2020-12-12 04:44

I have classes: Client, Server and Background is working with Player class. I really don\'t understand why my Client class with ObjectInputStream/ObjectOu

3条回答
  •  眼角桃花
    2020-12-12 04:55

    You need to construct the ObjectOutputStream before the ObjectInputStream, at both ends. At present you have a deadlock.

    You also need to move the closes outside the loops.

提交回复
热议问题