initIdleStateLocked initializes common state to how it should be while idle.
()
| 424 | |
| 425 | // initIdleStateLocked initializes common state to how it should be while idle. |
| 426 | func (cc *ClientConn) initIdleStateLocked() { |
| 427 | cc.resolverWrapper = newCCResolverWrapper(cc) |
| 428 | cc.balancerWrapper = newCCBalancerWrapper(cc) |
| 429 | cc.firstResolveEvent = grpcsync.NewEvent() |
| 430 | // cc.conns == nil is a proxy for the ClientConn being closed. So, instead |
| 431 | // of setting it to nil here, we recreate the map. This also means that we |
| 432 | // don't have to do this when exiting idle mode. |
| 433 | cc.conns = make(map[*addrConn]struct{}) |
| 434 | } |
| 435 | |
| 436 | // enterIdleMode puts the channel in idle mode, and as part of it shuts down the |
| 437 | // name resolver, load balancer, and any subchannels. This should never be |
no test coverage detected