NewHTTP2Connection returns a new instance of HTTP2Connection.
( conn net.Conn, orchestrator Orchestrator, connOptions *client.ConnectionOptionsSnapshot, observer *Observer, connIndex uint8, controlStreamHandler ControlStreamHandler, log *zerolog.Logger, )
| 52 | |
| 53 | // NewHTTP2Connection returns a new instance of HTTP2Connection. |
| 54 | func NewHTTP2Connection( |
| 55 | conn net.Conn, |
| 56 | orchestrator Orchestrator, |
| 57 | connOptions *client.ConnectionOptionsSnapshot, |
| 58 | observer *Observer, |
| 59 | connIndex uint8, |
| 60 | controlStreamHandler ControlStreamHandler, |
| 61 | log *zerolog.Logger, |
| 62 | ) *HTTP2Connection { |
| 63 | return &HTTP2Connection{ |
| 64 | conn: conn, |
| 65 | server: &http2.Server{ |
| 66 | MaxConcurrentStreams: MaxConcurrentStreams, |
| 67 | }, |
| 68 | orchestrator: orchestrator, |
| 69 | connOptions: connOptions, |
| 70 | observer: observer, |
| 71 | connIndex: connIndex, |
| 72 | controlStreamHandler: controlStreamHandler, |
| 73 | log: log, |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | // Serve serves an HTTP2 server that the edge can talk to. |
| 78 | func (c *HTTP2Connection) Serve(ctx context.Context) error { |
no outgoing calls