Proposal Details
It would be useful for ServerConn to provide a NewServerConnContext method next to NewServerConn.
We have to pass net.Conn to NewServerConn so we can already control deadlines and such externally but I think many of our users just use NewServerConn without thinking about it can hang forever.
// NewServerConnContext is like [NewServerConn] but also accepts a context. The
// provided Context must be non-nil. If the context expires before the handshake
// is complete, an error is returned. Once the handshake is completed, any
// expiration of the context will not affect the connection.
func NewServerConnContext(ctx context.Context, c net.Conn, config *ServerConfig) (*ServerConn, <-chan NewChannel, <-chan *Request, error)
Proposal Details
It would be useful for
ServerConnto provide aNewServerConnContextmethod next toNewServerConn.We have to pass
net.ConntoNewServerConnso we can already control deadlines and such externally but I think many of our users just useNewServerConnwithout thinking about it can hang forever.