Exemplo n.º 1
0
 static void Main(string[] args)
 {
     using (var client = new AsyncClient(Helper.GetLocalIpv4(), 11000))
     {
         client.Connect();
         for (int i = 0; i < 100; i++)
         {
             string response;
             client.Send(string.Format("Ahoj {0}", i), out response);
             Thread.Sleep(100);
             Console.WriteLine(response);
         }
         client.Close();
     }
 }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var client = new AsyncClient();

            client.Server = "Acer";
            client.Port   = 9876;
            client.Start();

            var now = "close";

            Console.WriteLine("To server: " + now);
            //client.StartClient(now);
            client.OnResponse += Client_OnResponse;

            client.Send(now);
            client.Receive();

            client.Close();

            Console.WriteLine("Exit...");
            Console.ReadKey();
        }
Exemplo n.º 3
0
 private void Send_btn_Click(object sender, EventArgs e)
 {
     AsyncClient.StartClient();
 }