This issue is part of a project to move x/net/http2 into std: #67810

HTTP/2 transports have a Transport.WriteByteTimeout configuration setting, which sets the maximum time a single write to a connection may take. The timeout begins when a write is made, and is extended whenever any data is written.

This setting can be used to detect unresponsive connections when the timeout for an entire request may be large or unbounded.

I propose extending this feature to apply to HTTP/2 server connections as well.

package http2

type Server struct { // contains unchanged fields
    // WriteByteTimeout is the timeout after which a connection will be
    // closed if no data can be written to it. The timeout begins when data is
    // available to write, and is extended whenever any bytes are written.
    WriteByteTimeout time.Duration
}

Adding this feature removes an inconsistency between HTTP/2 client and server configurations. Aligning the two will make it easier to add support for configuring HTTP/2 features to net/http, since we can define a single configuration struct rather than separate ones for clients and servers.

Comment From: rsc

Is this different from #61777?

Comment From: neild

Nope, just entirely forgot I'd filed that one.

Comment From: neild

Duplicate of #61777