When uploading a file using HttpWebRequest, the first two writes to the request stream always complete almost instantly. I thought there must be some kind of buffering happening so I disabled so I did this
_req.AllowWriteStreamBuffering = false;
But it hasn’t made any difference.
It’s kind of annoying because I measure upload speed by averaging the last 10 write speeds together, and so at first my application is showing an insanely fast speed and then dropping back down to 50kbps or so.
Would be nice if I could measure speed starting from the first write.
Any ideas?
The TCP stack is likely to take an initial write window from the application really quickly. It is sending the data in the background (after having accepted it instantly).
AllowWriteStreamBufferingtellsHttpWebRequestnot to buffer. It does not tell TCP what to do.