When does c.Call(...)
return a non-nil value?
Can the c.Call(...)
only return an error when a network failure occurs (packets lost or timed out or something along those lines)?
If the server srv
crashes, will c.Call(...)
return an error?
Specifically, can c.Call(...)
return an error AFTER the request successfully arrived at srv
but BEFORE the rpcname
handler function returns?
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
}