MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / DialToNodeWithPool

Function DialToNodeWithPool

rpc/utils.go:42–48  ·  view source on GitHub ↗

DialToNodeWithPool ties use connection in pool, if fails then connects to the node with nodeID.

(pool NOClientPool, nodeID proto.NodeID, isAnonymous bool)

Source from the content-addressed store, hash-verified

40
41// DialToNodeWithPool ties use connection in pool, if fails then connects to the node with nodeID.
42func 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}

Callers 6

TestStartBP_CallRPCFunction · 0.92
TestEncPingFindNeighborFunction · 0.92
CallNodeWithContextMethod · 0.85
initClientMethod · 0.85

Calls 2

GetExMethod · 0.65
GetMethod · 0.65

Tested by 4

TestStartBP_CallRPCFunction · 0.74
TestEncPingFindNeighborFunction · 0.74