posted 22 years ago
Hello Sanjay -
Flushing the object output stream just after construction of the same solves the problem, even if the underlain stream is a buffered stream:
<code snippet>
...
// -----------------------------------------
// Construct the object output stream - i.e.
// get the 'someOutStream' from your socket.
// -----------------------------------------
ObjectOutputStream oos = new ObjectOutputStream(someBufferedOutStream);
// -----------------------------------------
// Flush the stream just after constuction,
// because the stream's header data is to
// be pushed to the waiting corresponding
// input stream ... There seems to be no
// other way to send the stream's header data:
// -----------------------------------------
oos.flush();
...
</code snippet>
Still the order of the streams being created is important -
hope this helps,
Siegfried