MCPcopy Create free account
hub / github.com/cppla/moto / outboundDial

Function outboundDial

controller/prewarm.go:148–157  ·  view source on GitHub ↗

outboundDial 先尝试预热池,失败再发起新建连接。 之前返回 (conn, usedFlag, error),由于当前不再区分来源,精简为 (conn, error)。

(addr string)

Source from the content-addressed store, hash-verified

146// outboundDial 先尝试预热池,失败再发起新建连接。
147// 之前返回 (conn, usedFlag, error),由于当前不再区分来源,精简为 (conn, error)。
148func outboundDial(addr string) (net.Conn, error) {
149 if conn, ok := acquirePrewarmed(addr); ok {
150 return conn, nil
151 }
152 c, err := DialFast(addr)
153 if err != nil {
154 return nil, err
155 }
156 return c, nil
157}

Callers 5

HandleNormalFunction · 0.85
lazyRevalidateFunction · 0.85
HandleBoostFunction · 0.85
HandleRoundrobinFunction · 0.85
HandleRegexpFunction · 0.85

Calls 2

acquirePrewarmedFunction · 0.85
DialFastFunction · 0.85

Tested by

no test coverage detected