我在我的Android项目中使用Retrofit/OkHttp(1.6).
我没有找到内置于其中任何一个的任何请求重试机制.在搜索更多时,我看到OkHttp似乎有沉默重试.我没有看到我的任何连接(HTTP或HTTPS)发生这种情况.如何使用okclient配置重试?
现在,我正在捕获异常并重试维护计数器变量.
我试图从call()返回一个二维数组,我遇到了一些问题.到目前为止我的代码是:
//this is the end of main
Thread t1 = new Thread(new ArrayMultiplication(Array1, Array2, length));
t1.start();
}
public int[][] call(int[][] answer)
{
int[][] answer = new int[length][length];
answer = multiplyArray(Array1, Array2, length); //off to another function which returns the answer to here
return answer;
}
Run Code Online (Sandbox Code Playgroud)
这段代码编译,这不是返回我的数组.我确定我可能使用了错误的语法,但我找不到任何好的例子.
编辑:改了一下