Re: End of Stream encountered before parsing was completed
- From: Guru <Guru@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 19 Jun 2006 03:27:03 -0700
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]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"Guru" <Guru@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C682100E-FC37-4070-93F4-0AB879C2D3B4@xxxxxxxxxxxxxxxx
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
- References:
- Re: End of Stream encountered before parsing was completed
- From: Nicholas Paldino [.NET/C# MVP]
- Re: End of Stream encountered before parsing was completed
- Prev by Date: Self-aware class
- Next by Date: Re: Self-aware class
- Previous by thread: Re: End of Stream encountered before parsing was completed
- Next by thread: Event Processing?
- Index(es):
Relevant Pages
|