TCP client and server, cmd prompt using objectstreams

后端 未结 1 1243
没有蜡笔的小新
没有蜡笔的小新 2021-01-29 10:59

I have one client file clientRPC.java and server file serverRPC.java. Both communicate using TCP protocol and use objectinput and output stream to transfer data.

my clie

1条回答
  •  隐瞒了意图╮
    2021-01-29 11:13

    You're writing an object with writeObject() and trying to read it with readUTF(). Illogical.

    • objects written with writeObject() must be read with readObject().
    • strings written with writeUTF() must be read with readUTF().
    • primitives written with writeXXX() must be read with readXXX(), for most values of X.

    0 讨论(0)
提交回复
热议问题