File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3,31 +3,37 @@ package main
33import (
44 "errors"
55 "fmt"
6- "github.com/DistributedClocks/GoVector/govec"
7- "github.com/DistributedClocks/GoVector/govec/vrpc"
86 "log"
97 "net"
108 "net/rpc"
119 "time"
10+
11+ "github.com/DistributedClocks/GoVector/govec"
12+ "github.com/DistributedClocks/GoVector/govec/vrpc"
1213)
1314
1415var done chan int = make (chan int , 1 )
1516
17+ //Args are matematical arguments for the rpc operations
1618type Args struct {
1719 A , B int
1820}
1921
22+ //Quotient is the result of a Divide RPC
2023type Quotient struct {
2124 Quo , Rem int
2225}
2326
27+ //Arith is an RPC math server type
2428type Arith int
2529
30+ //Multiply performs multiplication on two integers
2631func (t * Arith ) Multiply (args * Args , reply * int ) error {
2732 * reply = args .A * args .B
2833 return nil
2934}
3035
36+ //Divide divides a by b and returns a quotient with a remainder
3137func (t * Arith ) Divide (args * Args , quo * Quotient ) error {
3238 if args .B == 0 {
3339 return errors .New ("divide by zero" )
You can’t perform that action at this time.
0 commit comments