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

Method initIdleStateLocked

clientconn.go:426–434  ·  view source on GitHub ↗

initIdleStateLocked initializes common state to how it should be while idle.

()

Source from the content-addressed store, hash-verified

424
425// initIdleStateLocked initializes common state to how it should be while idle.
426func (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

Callers 2

NewClientFunction · 0.95
enterIdleModeMethod · 0.95

Calls 3

NewEventFunction · 0.92
newCCResolverWrapperFunction · 0.85
newCCBalancerWrapperFunction · 0.85

Tested by

no test coverage detected