September 2017
Intermediate to advanced
466 pages
9h 33m
English
This subsection will present an RPC server named RPCserver.go. As you will see in the preamble of the RPCserver.go program, the RPC server imports a package named sharedRPC, which is implemented in the sharedRPC.go file: the name of the package is arbitrary. Its contents are the following:
package sharedRPC
type MyInts struct {
A1, A2 uint
S1, S2 bool
}
type MyInterface interface {
Add(arguments *MyInts, reply *int) error
Subtract(arguments *MyInts, reply *int) error
}
So, here you define a new structure that holds the signs and the values of two unsigned integers and a new interface named MyInterface.
Then, you should install sharedRPC.go, which means that you should execute the following commands before you try to use the ...
Read now
Unlock full access