getReadyTransport returns the transport if ac's state is READY or nil if not.
()
| 1678 | |
| 1679 | // getReadyTransport returns the transport if ac's state is READY or nil if not. |
| 1680 | func (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 | // |