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

Method greet

test/clienttester.go:50–70  ·  view source on GitHub ↗

greet() performs the necessary steps for http2 connection establishment on the server side.

()

Source from the content-addressed store, hash-verified

48// greet() performs the necessary steps for http2 connection establishment on
49// the server side.
50func (ct *clientTester) greet() {
51 ct.wantClientPreface()
52 ct.wantSettingsFrame()
53 ct.writeSettingsFrame()
54 ct.writeSettingsAck()
55
56 for {
57 f, err := ct.fr.ReadFrame()
58 if err != nil {
59 ct.t.Errorf("error reading frame from client side: %v", err)
60 }
61 switch f := f.(type) {
62 case *http2.SettingsFrame:
63 if f.IsAck() { // HTTP/2 handshake completed.
64 return
65 }
66 default:
67 ct.t.Errorf("during greet, unexpected frame type %T", f)
68 }
69 }
70}
71
72func (ct *clientTester) wantClientPreface() {
73 preface := make([]byte, len(clientPreface))

Callers 1

newClientTesterFunction · 0.95

Calls 5

wantClientPrefaceMethod · 0.95
wantSettingsFrameMethod · 0.95
writeSettingsFrameMethod · 0.95
writeSettingsAckMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected