Re: How to know when WriteStreamSample has written the sample to d

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Well, it's easy to test. Just write to a remote disk over a "slow" network
and you will see that the writestreamsample continue to return directly and
the memory used by your test application will increase. When you have written
the whole file and call EndWriting on the Writer you will see that it doesn't
return before all data is written to the remote disk. At least that is a good
behaviour...
If you also monitor the network you will see that after you called
writestreamsample for the last time, the traffic will continue until the
WmWriter "outputbuffer" is empty.
As you understand this behaviour is devastating when exporting large files
over the network, or just to a slow disk.

For now I limit that outpuffer by countig the written bytes and compare it
to the actual file size. But I still got the feeling that this must be a
common usecase and that it should be possible to control the output buffer in
a better way...

Thanks
/Fredrik



.