DialToNodeWithPool ties use connection in pool, if fails then connects to the node with nodeID.
(pool NOClientPool, nodeID proto.NodeID, isAnonymous bool)
| 40 | |
| 41 | // DialToNodeWithPool ties use connection in pool, if fails then connects to the node with nodeID. |
| 42 | func DialToNodeWithPool(pool NOClientPool, nodeID proto.NodeID, isAnonymous bool) (Client, error) { |
| 43 | if isAnonymous { |
| 44 | return pool.GetEx(nodeID, true) |
| 45 | } |
| 46 | //log.WithField("poolSize", pool.Len()).Debug("session pool size") |
| 47 | return pool.Get(nodeID) |
| 48 | } |