コード例 #1
0
 public void Close()
 {
     EndConnectionServerThread();
     if (connectionServerClient != null)
     {
         connectionServerClient.Close();
         connectionServerClient.Abort();
     }
     if (serviceClient != null)
     {
         serviceClient.Close();
         serviceClient.Abort();
     }
 }
コード例 #2
0
 /// <summary>
 /// 连接服务器检测
 /// </summary>
 private void ConnectionServerTesting()
 {
     while (true)
     {
         Debug.Log("ConnectionServerTesting!");
         if (connectionServerClient != null)
         {
             connectionServerClient.Abort();
         }
         connectionServerClient = CreateServiceClient();
         connectionServerClient.HelloCompleted -= ConnectionServerCallBack;
         connectionServerClient.HelloCompleted += ConnectionServerCallBack;
         connectionServerClient.HelloAsync("1");//心跳包
         Thread.Sleep(1000);
     }
 }