public static void TestConn() { var client = ServerConnector.EstablishConnection("23.95.51.146", 29015); Console.WriteLine("Established connection"); var response = ServerConnector.GetData(ref client, System.IO.File.ReadAllBytes(@"E:\send.bin")); Console.WriteLine("Got response of length " + response.Length); Console.WriteLine(Encoding.ASCII.GetString(response)); Console.ReadLine(); }
private UdpClient GetConn() { if (connectionAlive) { //return existing connection return(connection); } else { var client = ServerConnector.EstablishConnection(endpoint); connection = client; connectionAlive = true; return(client); } }