mnew
Posts: 4
Joined: Tue Oct 14, 2008 8:30 pm
Location: USA

Stream, ServiceStream, SetLength

Wed Oct 22, 2008 9:29 pm

Hi,

ServiceStream has SetLength() method which overrides the SetLength() method of System.IO.Stream.

I have,

ServiceStream m_Stream = (RemoteService)services[0];

and I need to flush the stream between reads and writes.
I found calling m_Stream.Flush() does not set the stream length to zero. So I did

m_Stream.SetLength(0);

but it throws exception saying that ServiceStream cannot Set Length.
Why is it?

I also did
Stream m_Stream = (RemoteService)services[0];
instread of
ServiceStream m_Stream = (RemoteService)services[0];
Either way doesn't work.

So how to set length to 0 when flushing the stream?



MY

Jonas
Posts: 2319
Joined: Mon Jan 09, 2006 2:20 pm
Location: Sweden

RE: Stream, ServiceStream, SetLength

Wed Oct 22, 2008 10:27 pm

You can't set the length of a ServiceStream as far as I know. You need your other side to read the data off the Stream at one end.
On the other hand, I don't see the need to flush the Stream between reads and writes either.

Regards,
Jonas

Return to “BlueTools”