How can you clear the data in a network stream without disposing it?
Dim ns As NetworkStream
Edit:
Based on the comment below by James, it seems that this question is not yet answered properly.
I thought doing:
ns = Nothing
would clear the network stream, but I was wrong.
I assume by “clear the network stream,” you mean you want to empty the input buffer?
That throws away all the data, but leaves the stream open for reading.
If you mean that you want to clear the output buffer (on a writeable stream), I have no idea. You’ll probably have to close the stream and create a new one.