diff --git a/pool/pool.go b/pool/pool.go index 57a9f39..1924a49 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -96,12 +96,15 @@ func NewCustom(network, addr string, size int, df DialFunc, os ...Opt) (*Pool, e doEvery(po.pingInterval, func() { // instead of using Cmd/Get, which might make a new connection, // we only check from the pool - select { - case conn := <-p.pool: - // we don't care if PING errors since Put will handle that - conn.Cmd("PING") - p.Put(conn) - default: + //ping for every socket + for i:=0;i