code: func NewRPCClient(conn io.ReadWriteCloser, plugins map[string]Plugin) (*RPCClient, error) {
  	// Create the yamux client so we can multiplex
  	mux, err := yamux.Client(conn, nil)
  	if err != nil {
  		conn.Close()
  		return nil, err
  	}
  
  	// Connect to the control stream.
  	control, err := mux.Open()
  	if err != nil {
  		mux.Close()
  		return nil, err
  	}
  
  	// Connect stdout, stderr streams
  	stdstream := make([]net.Conn, 2)
  	for i, _ := range stdstream {
  		stdstream[i], err = mux.Open()
  		if err != nil {
  			mux.Close()
  			return nil, err
  		}
  	}
  
  	// Create the broker and start it up
  	broker := newMuxBroker(mux)
  	go broker.Run()
  
  	// Build the client using our broker and control channel.
  	return &RPCClient{
  		broker:  broker,
  		control: rpc.NewClient(control),
  		plugins: plugins,
  		stdout:  stdstream[0],
  		stderr:  stdstream[1],
  	}, nil
  }
docs: // NewRPCClient creates a client from an already-open connection-like value.
  // Dial is typically used instead.