code: func RPCAccept(ln net.Listener, server *rpc.Server) error {
  	errClosing := errors.New("use of closed network connection")
  	for {
  		conn, err := ln.Accept()
  		if err != nil {
  			if ne, ok := err.(net.Error); ok && ne.Temporary() {
  				log.Warningf("RPC accept temporary error: %v", err)
  				time.Sleep(1 * time.Second)
  				continue
  			}
  			if oe, ok := err.(*net.OpError); ok && oe.Err.Error() == errClosing.Error() {
  				log.Infoln("RPC accept connection closed")
  				return nil
  			}
  			log.Errorf("RPC accept error: %v", err)
  			return err
  		}
  		go server.ServeConn(conn)
  	}
  }
docs: // RPCAccept accepts connections on the listener and dispatches them to the
  // RPC server for service. Unfortunately the native Go rpc.Accept function
  // fatals on any accept error, including temporary failures and closure of
  // the listener.