/// <summary> /// 断开连接 /// </summary> public void StopConnection() { HeartTimeStop(); receiveThread.Abort(); //缺少对receive是否完成的判断 receiveThread = new Thread(ReceiveHandle) { IsBackground = true }; tcpSocket.DisconnectServer(); Log.log.Debug("StopConnection success"); online = false; Log.log.Debug("exit"); }
/// <summary> /// 断开连接 /// </summary> public void StopConnection() { online = false; ack = 0; RecHeartTimerStop(); SendHeartTimerStop(); receiveThread.Abort(); //缺少对receive是否完成的判断 receiveThread = new Thread(ReceiveHandle) { IsBackground = true }; tcpSocket.DisconnectServer(); Log.log.Info("StopConnection success"); }