示例#1
0
        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();
        }
示例#2
0
 private UdpClient GetConn()
 {
     if (connectionAlive)
     {
         //return existing connection
         return(connection);
     }
     else
     {
         var client = ServerConnector.EstablishConnection(endpoint);
         connection      = client;
         connectionAlive = true;
         return(client);
     }
 }