This will only redial if the initial Dial fails. What happens if the
original Dial is successful, but the connection goes away (ie, the
server dies)? In that case, you need to Dial again to re-establish the
connection (make sure you Close it first).
Andrew
os.Error is an interface, so you can make your own types that
implement that interface. There's even a helper function to do it for
you:
var (
InvalidRequestError = os.NewError("invalid request")
InternalError = os.NewError("internal server error")
)
Then you can test whether the error value returned by Call is one of
your application's errors. A switch is helpful here:
err := c.Call("Server.Method", &args, &result)
if err != nil {
switch err {
case InvalidRequestError:
// etc
case InternalError:
// etc
default:
// some other error
}
Andrew