Parse中的陷阱超时

时间:2014-10-13 16:48:24

标签: c# ios .net parse-platform xamarin

Parse文档指出:“默认情况下,所有连接的超时时间均为10秒,因此任务不会无限期挂起。” 我有这个代码(来自Parse网站:

try
{
 Task t=test.SaveAsync();
 await t;
 int j = t.Id;
}
catch (ParseException exc)
{
 if (exc.Code == ParseException.ErrorCode.ObjectNotFound)
 {
  // Uh oh, we couldn't find the object!
 }
 else
 {
  //Some other error occurred
 }
}

我在网络上运行我的应用程序(在iPhone / Xamarin上),然后我设置100%网络丢失,然后我运行上面的代码。我没有得到异常,代码也没有在我读取任务ID的await语句之后到达该行。换句话说,我不知道发生了什么。 我的问题是:  如果没有网络,如何捕获Pasre超时?是否有我可以使用的事件,或者我必须自己实施,包括计时器和所有事件?

谢谢,不要escamilloATgmail.com

0 个答案:

没有答案