Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+11 votes

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

asked in CSC335_Spring2019 by (1 point)

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 (1 point)
selected by
+6

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!

...