Golang net/rpc.Client.Call() function example

package net/rpc

Golang net/rpc.Client.Call() function usage example

 type Args struct {
 A, B int
 }

 args := Args{8,8}
 var reply int
 err = client.Call("Operator.Multiply", args, &reply)

 if err != nil {
 panic(err)
 }

 fmt.Printf(" %d * %d = %d \n ", args.A, args.B, reply)

Reference :

http://golang.org/pkg/net/rpc/#Client.Call

Advertisement