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.


+10 votes

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

asked in CSC335_Spring2019 by (8 points)

1 Answer

+8 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 by (8 points)
selected by

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!