Low level access to outgoing stream with HttpMessageInvoker.SendAsync / HttpContent.SerializeToStreamAsync #35358
Labels
area-System.Net.Http
backlog-cleanup-candidate
An inactive issue that has been marked for automated closure.
no-recent-activity
Milestone
In some scenarios (see e.g. YARP proxying code to handle gRPC duplex channels) we would like to do unbuffered writes to the outbound http request stream.
RawConnectionStream
for example does unbuffered writes, but we only get a RawConnectionStream in response to a CONNECT request or HTTP/1.1 upgrade (source).The precise ask on this issue is not fully formalized at this point, but we would want something along the lines of an opt-in to use
RawConnectionStream
for all requests in a SocketsHttpHandler so that arbitrary protocols on top of HTTP/2 (e.g. gRPC) can be proxied transparently in YARP. Because there is no such facility today, we end up resorting to brittle solutions like this, calling FlushAsync after every WriteAsync. This is brittle because it relies on the fact that the call to flush will not actually call flush on the socket. If it did, perf might be abysmal. we shouldn't rely on implementation details to achieve the high level scenario.The text was updated successfully, but these errors were encountered: