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

Method connect

clientconn.go:982–1000  ·  view source on GitHub ↗

connect starts creating a transport. It does nothing if the ac is not IDLE. TODO(bar) Move this to the addrConn section.

()

Source from the content-addressed store, hash-verified

980// It does nothing if the ac is not IDLE.
981// TODO(bar) Move this to the addrConn section.
982func (ac *addrConn) connect() {
983 ac.mu.Lock()
984 if ac.state == connectivity.Shutdown {
985 if logger.V(2) {
986 logger.Infof("connect called on shutdown addrConn; ignoring.")
987 }
988 ac.mu.Unlock()
989 return
990 }
991 if ac.state != connectivity.Idle {
992 if logger.V(2) {
993 logger.Infof("connect called on addrConn in non-idle state (%v); ignoring.", ac.state)
994 }
995 ac.mu.Unlock()
996 return
997 }
998
999 ac.resetTransportAndUnlock()
1000}
1001
1002// equalAddressIgnoringBalAttributes returns true is a and b are considered equal.
1003// This is different from the Equal method on the resolver.Address type which

Callers 1

ConnectMethod · 0.80

Calls 5

VMethod · 0.65
InfofMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected