You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client.Go use the same buffer chan *rpc.Call.
The test output is different
-----------------------------------------------------------
Win6/amd64
go version
go version devel +24deeb374803 Tue Jun 04 21:51:22 2013 -0700 windows/amd64
go run rpctest.go
2013/06/06 16:55:14 Add: expected 0 got 15
exit status 1
-----------------------------------------------------------
CentOS6.3/amd64
go version
go version go1.1 linux/amd64
go run rpctest.go
Arith: 7+8=15
Arith: 7*8=56
-----------------------------------------------------------
IMHO: Works as intended. The attached rpctest.go is buggy
from line 53 on (a bit restructured)
done := done := make(chan *rpc.Call, 8)
addReply, mulReply := new(Reply), new(Reply)
mulCall := client.Go("Arith.Mul", args, mulReply, done)
addCall := client.Go("Arith.Add", args, addReply, done)
addCall = <-addCall.Done
if addReply.C != args.A+args.B {
log.Fatalf("Add: expected %d got %d", addReply.C, args.A+args.B)
}
So: addCall.Done == mulCal.Done == done
Now addCall = <-addCall.Done is basically
firstFinishedCall := <- done; addCall = firstFinishedCall
which might be the multiplication.
Testing now for addReply != something if wrong as the
firstFinishedCall might not be the addition
(even when stored into a variable called "addCall").
Attachments:
The text was updated successfully, but these errors were encountered: