func (p *Peer) RequestVoteMe(lastLogIndex, lastTerm uint64) {
	conn, err := grpc.Dial(p.Host, grpc.WithInsecure())
	if err != nil {
		logger.Errorf("dail rpc failed, err: %s\n", err)
		if conn != nil {
			conn.Close()
		}
		return
	}
	defer conn.Close()
	client := pb.NewRequestVoteClient(conn)
	votereq := &pb.VoteRequest{
		Term:          p.server.currentTerm,
		LastLogIndex:  lastLogIndex,
		LastLogTerm:   lastTerm,
		CandidateName: p.server.conf.Name,
		Host:          p.server.conf.Host,
	}
	res, err := client.RequestVoteMe(context.Background(), votereq)
	resp := &RequestVoteRespChan{
		Resp:     res,
		PeerHost: p.Host,
		PeerName: p.Name,
	}
	if err != nil {
		resp.Failed = true
		p.server.ch <- resp
	} else {
		resp.Failed = false
		p.server.ch <- resp
	}
}
RequestVoteMe send request for leader votion
package raft
import (
	"sync"
	"time"
	pb "github.com/moxiaomomo/goRaft/proto"
	"github.com/moxiaomomo/goRaft/util/logger"
	"golang.org/x/net/context"
	"google.golang.org/grpc"
)
type Peer struct {
	server           *server
	Name             string
	Host             string
	voteRequestState int
	lastActivity      time.Time
	heartbeatInterval time.Duration
	mutex sync.RWMutex
}
type RequestVoteRespChan struct {
	Failed   bool
	Resp     *pb.VoteResponse
	PeerHost string
	PeerName string
}
type AppendLogRespChan struct {
	Failed   bool
	Resp     *pb.AppendEntriesResponse
	PeerHost string
	PeerName string
}
func NewPeer(server *server, name, host string, heartbeatInterval time.Duration) *Peer {
	return &Peer{
		server:            server,
		Name:              name,
		Host:              host,
		voteRequestState:  NotYetVote,
		heartbeatInterval: heartbeatInterval,
	}
}
func (p *Peer) SetVoteRequestState(state int) {
	p.mutex.Lock()
	defer p.mutex.Unlock()
	p.voteRequestState = state
}
func (p *Peer) VoteRequestState() int {
	p.mutex.Lock()
	defer p.mutex.Unlock()
	return p.voteRequestState
}