Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+9 votes

We are using TCP object streams and this error popped up, what's causing it?

asked ago in CSC335_Spring2019 by (3.4k points)

1 Answer

+7 votes
 
Best answer

This error occurs if you are creating an input stream or output stream on either the client or server communication classes more than once. You should only create each once once.

answered ago by (3.3k points)
selected ago by
+5

More specifically, the issue occurs if you are using TCP and creating a new ObjectInputStream or ObjectOutputStream for the same socket's input stream or outputstream more than once.

Each socket should have just ONE ObjectInputStream and ObjectOutputStream associated with it!

...