| | |
| | | // System.Threading.Thread.Sleep (10 * 1000); |
| | | // if (CommonPage.IsRemote) { |
| | | // Control.ControlBytesSend (Command.ReadRemark, 0, 0, new byte [] { }, SendCount.Zero); |
| | | // Console.WriteLine ("心跳包"); |
| | | // Utlis.WriteLine ("心跳包"); |
| | | // } |
| | | // } |
| | | //}); |
| | |
| | | // while (true) { |
| | | // System.Threading.Thread.Sleep (10 * 1000); |
| | | // if (CommonPage.IsRemote) { |
| | | // Console.WriteLine ("心跳包"); |
| | | // Utlis.WriteLine ("心跳包"); |
| | | // byte [] backBytes = Control.ControlBytesSendHasReturn (Command.ReadRemark, 0, 0, new byte [] { }); |
| | | // if (backBytes != null) { |
| | | // Console.WriteLine ("心跳包 收到回复"); |
| | | // Utlis.WriteLine ("心跳包 收到回复"); |
| | | // } |
| | | |
| | | // } |
| | |
| | | byte [] bytes = null; |
| | | var dateTime = DateTime.Now; |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | bytes = new System.Net.WebClient { Proxy = null }.DownloadData ("http://www.baidu.com"); |
| | | bytes = new System.Net.WebClient { Proxy = null }.DownloadData ("https://smarth-api.havells.com"); |
| | | }); |
| | | while ((DateTime.Now - dateTime).TotalMilliseconds < 8000) { |
| | | System.Threading.Thread.Sleep (100); |
| | |
| | | } |
| | | } |
| | | } catch (Exception ex) { |
| | | Console.WriteLine (ex.Message); |
| | | Utlis.WriteLine (ex.Message); |
| | | } finally { |
| | | if (!result) { |
| | | Application.RunOnMainThread (() => { |