예제 #1
0
 public void StartClient(int i)
 {
     //threads[i] = new Thread(delegate ()
     {
         //Thread.Sleep(rd.Next(500, 5000));
         sockets[i] = HyperSocket.CreateClient("127.0.0.1", 8888, new ClientListener());
     }//);
      //threads[i].Start();
 }
예제 #2
0
 public void StartClient()
 {
     socket = HyperSocket.CreateClient("127.0.0.1", 8888, new ClientListener());
     while (true)
     {
         var id      = Console.ReadLine();
         var str     = Console.ReadLine();
         var jsonObj = new JObject();
         jsonObj.Add("id", int.Parse(id));
         jsonObj.Add("msg", str);
         socket.SendUdp(jsonObj.AsBytes());
     }
 }