コード例 #1
0
ファイル: Client.cs プロジェクト: ScarletLib/Scarlet
 /// <summary> Starts the threads for the receive, send, and processing systems. </summary>
 private static void StartThreads()
 {
     SendThread.Start();                         // Start sending packets
     ProcessThread.Start();                      // Begin processing packets
     ReceiveThreadTCP.Start(ServerTCP.Client);   // Start receiving on the TCP socket
     ReceiveThreadUDP.Start(ServerUDP.Client);   // Start receiving on the UDP socket
 }
コード例 #2
0
ファイル: Client.cs プロジェクト: ScarletLib/Scarlet
 /// <summary>
 /// Stops the Client.
 /// Removes all packets from the receuve and send queues.
 /// Changes the initialization state of the Client.
 /// </summary>
 public static void Stop()
 {
     StopProcesses = true;
     if (ThreadsStarted)
     {
         SendThread.Join();
         ProcessThread.Join();
         ReceiveThreadTCP.Join();
         ReceiveThreadUDP.Join();
     }
     Initialized = false;
 }