Alias
func main() {
flag.Parse()
d := client.NewPeer2PeerDiscovery("tcp@"+*addr, "")
option.ReadTimeout = 10 * time.Second
xclient := client.NewXClient("a.b.c.d", client.Failtry, client.RandomSelect, d, option)
defer xclient.Close()
args := &example.Args{
A: 10,
B: 20,
reply := &example.Reply{}
err := xclient.Call(context.Background(), "Times", args, reply)
if err != nil {
log.Fatalf("failed to call: %v", err)
}
log.Printf("%d * %d = %d", args.A, args.B, reply.C)
}