private void getHeartBeatRequestMsg(String msg) { try { Thread t; string ipport = GetIP() + ":" + GetPort(); string target = " "; string reply = " "; XDocument xml = XDocument.Parse(msg); var q = from x in xml.Descendants() where (x.Name == "root") select x; foreach (var elem in q) target = elem.Value; MessageGenerator temp = new MessageGenerator(); reply = temp.msgHeartBeatReply(ipport); AsynchronousClient client = new AsynchronousClient(); string[] str = target.Split(':'); string ip = str[0]; string port = str[1]; client.SetSingleMsg(ip, port, reply); t = new Thread(new ThreadStart(client.SendSingleClient)); t.IsBackground = true; t.Start(); } catch (Exception e) { Console.WriteLine(e.ToString()); } }