MCPcopy
hub / github.com/grpc/grpc-go / http2Client

Struct http2Client

internal/transport/http2_client.go:71–159  ·  view source on GitHub ↗

http2Client implements the ClientTransport interface with HTTP2.

Source from the content-addressed store, hash-verified

69
70// http2Client implements the ClientTransport interface with HTTP2.
71type http2Client struct {
72 lastRead int64 // Keep this field 64-bit aligned. Accessed atomically.
73 ctx context.Context
74 cancel context.CancelFunc
75 ctxDone <-chan struct{} // Cache the ctx.Done() chan.
76 userAgent string
77 // address contains the resolver returned address for this transport.
78 // If the `ServerName` field is set, it takes precedence over `CallHdr.Host`
79 // passed to `NewStream`, when determining the :authority header.
80 address resolver.Address
81 md metadata.MD
82 conn net.Conn // underlying communication channel
83 loopy *loopyWriter
84 remoteAddr net.Addr
85 localAddr net.Addr
86 authInfo credentials.AuthInfo // auth info about the connection
87
88 readerDone chan struct{} // sync point to enable testing.
89 writerDone chan struct{} // sync point to enable testing.
90 // goAway is closed to notify the upper layer (i.e., addrConn.transportMonitor)
91 // that the server sent GoAway on this transport.
92 goAway chan struct{}
93 keepaliveDone chan struct{} // Closed when the keepalive goroutine exits.
94 framer *framer
95 // controlBuf delivers all the control related tasks (e.g., window
96 // updates, reset streams, and various settings) to the controller.
97 // Do not access controlBuf with mu held.
98 controlBuf *controlBuffer
99 fc *trInFlow
100 // The scheme used: https if TLS is on, http otherwise.
101 scheme string
102
103 isSecure bool
104
105 perRPCCreds []credentials.PerRPCCredentials
106
107 kp keepalive.ClientParameters
108 keepaliveEnabled bool
109
110 statsHandler stats.Handler
111
112 initialWindowSize int32
113
114 // configured by peer through SETTINGS_MAX_HEADER_LIST_SIZE
115 maxSendHeaderListSize *uint32
116
117 bdpEst *bdpEstimator
118
119 maxConcurrentStreams uint32
120 streamQuota int64
121 streamsQuotaAvailable chan struct{}
122 waitingStreams uint32
123 registeredCompressors string
124
125 // Do not access controlBuf with mu held.
126 mu sync.Mutex // guard the following variables
127 nextID uint32
128 state transportState

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected