"Charles" <Ch*****@discussions.microsoft.comwrote in message
news:9C**********************************@microsof t.com...
Is there a way to find out how many bytes NetworkStream Read/Write
actually
read/wrote when there is an exception (i.e. socket read/write timeout).
For reading, if you don't have a successful call to a receiving function,
you cannot safely expect there to be any data at all.
For writing, the best you can do is have something in your application
protocol in which the recipient can tell you how many bytes it received.
That's not exactly the same as how many bytes are written, but it's the best
you can do. If your application protocol has no way to report the bytes
received at the other end, then you have to assume that the entire write
failed.
Pete