public void Close() { EndConnectionServerThread(); if (connectionServerClient != null) { connectionServerClient.Close(); connectionServerClient.Abort(); } if (serviceClient != null) { serviceClient.Close(); serviceClient.Abort(); } }
/// <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); } }