When c.Call(...)does non-nil return?
Can it c.Call(...)return an error message when a network fails (packets are lost or timeout or something along these lines)?
If the server srvcrashes, will an c.Call(...)error be returned?
In particular, can it c.Call(...)return an error AFTER the request succeeds srv, but BEFORE the handler function returns rpcname?
import (
"net/rpc"
"fmt"
)
func call(srv string, rpcname string, args interface{}, reply interface{}) bool {
c, errx := rpc.Dial("unix", srv)
if errx != nil {
return false
}
defer c.Close()
err := c.Call(rpcname, args, reply)
if err == nil {
return true
}
fmt.Println(err)
return false
}
source
share