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

Function keepReading

test/clientconn_state_transition_test.go:55–57  ·  view source on GitHub ↗

Keep reading until something causes the connection to die (EOF, server closed, etc). Useful as a tool for mindlessly keeping the connection healthy, since the client will error if things like client prefaces are not accepted in a timely fashion.

(conn net.Conn)

Source from the content-addressed store, hash-verified

53// healthy, since the client will error if things like client prefaces are not
54// accepted in a timely fashion.
55func keepReading(conn net.Conn) {
56 io.Copy(io.Discard, conn)
57}
58
59type funcConnectivityStateSubscriber struct {
60 onMsg func(connectivity.State)

Calls 1

CopyMethod · 0.80

Tested by

no test coverage detected