newRpcServer returns an rpc server suitable for handling RPC connections for the passed node.
(n *Node)
| 40 | // newRpcServer returns an rpc server suitable for handling RPC connections for |
| 41 | // the passed node. |
| 42 | func 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. |
| 55 | func (r *rpcServer) shutdown() error { |