Example #1
0
        //static string remoteHost = "172.26.187.156";
        //static string host = "172.26.187.156";

        public static async void ConnectHost(Object obj)
        {
            int port = (int)obj;
            UdpClientConnection conn = new UdpClientConnection(host, port, remoteHost, 1230);

            var connectOK = await conn.ConnectAsync();

            if (connectOK)
            {
                Console.WriteLine("Client");
                Thread.Sleep(1000);
                sendMsg(conn, port);
            }
            else
            {
                Console.WriteLine("client connect server failed");
            }
            conn.Close();
        }