MCPcopy Create free account
hub / github.com/dadgar/onecache / newRpcServer

Function newRpcServer

onecache/onecache_rpc.go:42–52  ·  view source on GitHub ↗

newRpcServer returns an rpc server suitable for handling RPC connections for the passed node.

(n *Node)

Source from the content-addressed store, hash-verified

40// newRpcServer returns an rpc server suitable for handling RPC connections for
41// the passed node.
42func newRpcServer(n *Node) *rpcServer {
43 s := &rpcServer{
44 n: n,
45 versions: make(map[string]*ReplicaVersion),
46 rpc: rpc.NewServer(),
47 connPool: newPool(n.config.LogOutput, nodeRPCCache, nodeMaxStreams),
48 }
49
50 s.rpc.RegisterName("Node", s)
51 return s
52}
53
54// shutdown stops the rpc server from handling new connections.
55func (r *rpcServer) shutdown() error {

Callers 1

CreateFunction · 0.85

Calls 1

newPoolFunction · 0.85

Tested by

no test coverage detected