public static bool sendTo(IPEndPoint ip, String data) { using (TcpClient c = new TcpClient()) { try { c.Connect(ip); NetworkStream clientStream = c.GetStream(); ASCIIEncoding encoder = new ASCIIEncoding(); byte[] buffer = encoder.GetBytes(data); clientStream.Write(buffer, 0, buffer.Length); clientStream.Flush(); c.Close(); } catch { c.Close(); return false; } } return true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)