MCPcopy
hub / github.com/segmentio/kafka-go / removeConn

Method removeConn

transport.go:1095–1114  ·  view source on GitHub ↗
(c *conn)

Source from the content-addressed store, hash-verified

1093}
1094
1095func (g *connGroup) removeConn(c *conn) bool {
1096 g.mutex.Lock()
1097 defer g.mutex.Unlock()
1098
1099 if c.timer != nil {
1100 c.timer.Stop()
1101 }
1102
1103 for i, x := range g.idleConns {
1104 if x == c {
1105 copy(g.idleConns[i:], g.idleConns[i+1:])
1106 n := len(g.idleConns) - 1
1107 g.idleConns[n] = nil
1108 g.idleConns = g.idleConns[:n]
1109 return true
1110 }
1111 }
1112
1113 return false
1114}
1115
1116func (g *connGroup) releaseConn(c *conn) bool {
1117 idleTimeout := g.pool.idleTimeout

Callers 1

releaseConnMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected