Hi Nicholas
First Thanks for your reply...
Can you elloborate on code level. B'coz I am serializing the object(Object
o). So how to find the length and send it back?
Please give me some pointer.
My code is like :-
Serilizing:
-----------
IFormatter m_formatter;
NetworkStream n_stream;
.....
...
m_formatter.Serialize(n_stream,o);
....
....
Deserializing on TCP client:
------------------------------
....
....
Object o = m_formatter.Deserialize(n_stream);
.........
So any idea??
Thanks in advance..
Guru
"Nicholas Paldino [.NET/C# MVP]" wrote:
Guru,
It's very possible that the stream is closed for some reason (network
problems) before deserialization completes.
If you want to be sure, you should send some sort of length prefix
before the serialized object stream. Then, read the bytes into a local
buffer, then deserialize from that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Guru" <Gu**@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.com... Hi all
I've serializing an object to a Network stream but when trying to
deserialize
it comes back with
"End of Stream encountered before parsing was completed."
Using Binary formatter to send across.
Any idea how to solve this.
Thanks in advance.
Guru