SocketsHttpHandler: Support zero-byte read on response streams #61475
Labels
area-System.Net.Http
enhancement
Product code improvement that does NOT require public API changes/additions
tenet-performance
Performance related issue
Milestone
Supporting zero-byte read helps users of these APIs reduce memory usage. It allows them to release their read buffers when no data is currently available.
We should support this in our HTTP response streams in SocketsHttpHandler, including RawConnectionStream since this is used for WebSockets and tunneling scenarios.
Ideally we would also release our own read buffer (if any and if possible) and issue a zero-byte read against the underlying connection. This is what SslStream does (as of 6.0). The idea here is that the user has indicated their interest in minimizing buffer memory usage, and so we should do the same for our own internal buffers.
I split this issue off from #61223.
The text was updated successfully, but these errors were encountered: