MCPcopy
hub / github.com/redis/go-redis / GetNetConn

Method GetNetConn

internal/pool/conn.go:668–670  ·  view source on GitHub ↗

GetNetConn safely returns the current network connection using atomic load (lock-free). This method is used by the pool for health checks and provides better performance.

()

Source from the content-addressed store, hash-verified

666// GetNetConn safely returns the current network connection using atomic load (lock-free).
667// This method is used by the pool for health checks and provides better performance.
668func (cn *Conn) GetNetConn() net.Conn {
669 return cn.getNetConn()
670}
671
672// SetNetConnAndInitConn replaces the underlying connection and executes the initialization.
673// This method ensures only one initialization can happen at a time by using atomic state transitions.

Callers 1

Calls 1

getNetConnMethod · 0.95

Tested by

no test coverage detected