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

Method Connect

clientconn.go:738–746  ·  view source on GitHub ↗

Connect causes all subchannels in the ClientConn to attempt to connect if the channel is idle. Does not wait for the connection attempts to begin before returning. # Experimental Notice: This API is EXPERIMENTAL and may be changed or removed in a later release.

()

Source from the content-addressed store, hash-verified

736// Notice: This API is EXPERIMENTAL and may be changed or removed in a later
737// release.
738func (cc *ClientConn) Connect() {
739 cc.idlenessMgr.ExitIdleMode()
740
741 // If the ClientConn was not in idle mode, we need to call ExitIdle on the
742 // LB policy so that connections can be created.
743 cc.mu.Lock()
744 cc.balancerWrapper.exitIdle()
745 cc.mu.Unlock()
746}
747
748// waitForResolvedAddrs blocks until the resolver provides addresses or the
749// context expires, whichever happens first.

Callers

nothing calls this directly

Calls 4

ExitIdleModeMethod · 0.65
LockMethod · 0.45
exitIdleMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected