I have a client-server application in which the server sends a list of all clients to all clients every time a new client socket is connected. The problem is that when a new client joins, it gets the correct list, but old clients get the old list that they received when they connected. It seems that every time they take the same object from the input stream.
Is there any way to clear the input stream?
Reading an object:
while((inObject = in.readObject()) != null) {
...
}
Submission of the object:
out.writeObject(object);
source
share