Пример #1
0
 /// <summary>
 /// inva un messaggio con data e tempo ogni dieci secondi
 /// </summary>
 public void SendDateTime()
 {
     while (true)
     {
         mserver.SendToAll(DateTime.Now.ToString() + "\n");
         Thread.Sleep(10000);
     }
 }
 private void SendAll_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtMessage?.Text))
     {
         _asyncSocketServer?.SendToAll(txtMessage.Text.Trim());
     }
 }
Пример #3
0
 public void SendDateTime()
 {
     while (true)
     {
         mServer.SendToAll();
         Thread.Sleep(3000);
     }
 }
Пример #4
0
 private void Timer_Tick(object sender, EventArgs e)
 {
     mServer.SendToAll(DateTime.Now.ToShortDateString() + " ");
     mServer.SendToAll(DateTime.Now.ToShortTimeString());
 }