与本地主机的连接超时

时间:2013-08-05 23:24:26

标签: android rest get

我正在使用Android模拟器并尝试对位于我本地主机上的根文档执行GET请求,并允许我登录。

登录方法

     * @param rootDocumentUri        The Uri the login attempt is to be invoked against.
 * @param loginSuccessfulCallback The callback that is called if the login attempt was successful.
 * @param loginFailedCallback The callback that is called if the login attempt was not successful.
 * @param timeout           The length of time, in milliseconds, to wait for a response from the server.
 */
public void login(Uri rootDocumentUri, LoginCompletedListener loginSuccessfulCallback,
                  LoginCompletedListener loginFailedCallback, int timeout);

使用方法:

  MobileBaseUri = Address for my Uri.

         MobileApi.login(Uri.parse(MobileBaseUri), new LoginSuccessful(), new LoginFailed(), MobileSettings.getInstance().getHttpRequestTimeoutPeriod() );

当我尝试登录时,应用程序在RootDocument上执行GET,但我得到的全部是:“HttpClient(1884):org.apache.http.conn.ConnectTimeoutException:连接到/10.0.0.8:80超时“

超时设置为一分钟,服务器在我的本地主机上,所以我应该被任何防火墙阻止..

有谁知道这个问题是什么?

感谢。

0 个答案:

没有答案