diondokter

MainForm Loop

May 26th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1.         public void Executor()
  2.         {
  3.             while (true)
  4.             {
  5.                 foreach (NetworkClient Client in Connection.UnIdentifiedClients)
  6.                 {
  7.                     Client.Receive();
  8.                     SignalClass Signal = Client.GetOldestSignal(); //this is a class that contains a message
  9.                     if (Signal.ToServer)
  10.                     {
  11.                         if (Signal.Destination < 0)
  12.                         {
  13.                             ServerCommands.NewMessage(Signal);
  14.                         }
  15.                         else
  16.                         {
  17.                             Lobbies[Signal.Destination].NewMessage(Signal);
  18.                         }
  19.                     }
  20.                 }
  21.                 Thread.Sleep(20);
  22.             }
  23.         }
Advertisement
Add Comment
Please, Sign In to add comment