You're repeated sending the same object via serialization - and ObjectOutputStream
notices that, and instead resolves this to references to the same object.
If you want to effectively send a separate object on each call, add this to your loop:
streamOut.reset();
That way, every time you write the object, it will write it out as if it's never seen it before (and you'll get a new object on each readObject
call on the other side). Of course, that means the stream will be a lot bigger. Personally I'd consider using an alternative serialization technique such as Protocol Buffers, but that's a different matter...