Example #1
0
func rpcConnectLeader(urls []string) (net.Conn, error) {
	leader, err := getLeader(urls)
	if err != nil {
		return nil, errors.Trace(err)
	}
	conn, err := rpcutil.ConnectUrls(leader.GetAddr(), connectPDTimeout)
	if err != nil {
		return nil, errors.Trace(err)
	}
	return conn, nil
}
Example #2
0
func rpcConnect(urls []string) (net.Conn, error) {
	s := strings.Join(urls, ",")
	return rpcutil.ConnectUrls(s, connectPDTimeout)
}