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

Method getReadyTransport

clientconn.go:1680–1687  ·  view source on GitHub ↗

getReadyTransport returns the transport if ac's state is READY or nil if not.

()

Source from the content-addressed store, hash-verified

1678
1679// getReadyTransport returns the transport if ac's state is READY or nil if not.
1680func (ac *addrConn) getReadyTransport() transport.ClientTransport {
1681 ac.mu.Lock()
1682 defer ac.mu.Unlock()
1683 if ac.state == connectivity.Ready {
1684 return ac.transport
1685 }
1686 return nil
1687}
1688
1689// tearDown starts to tear down the addrConn.
1690//

Callers 2

pickMethod · 0.80
NewStreamMethod · 0.80

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected