Esempio n. 1
0
        public void Stop()
        {
            if (UserThreads != null)
            {
                foreach (var user in UserThreads)
                {
                    user.Abort();
                }
            }
            foreach (ServerUser u in Users)
            {
                u.Client.Close();
            }

            if (LobbyThread.ThreadState != ThreadState.Aborted)
            {
                Listener.Stop();
                LobbyThread.Abort();
                LobbyThread = null;
            }

            if (GameThread != null && GameThread.ThreadState != ThreadState.Aborted)
            {
                GameThread.Abort();
                GameThread = null;
            }
        }
Esempio n. 2
0
 protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
 {
     if (GameThread != null)
     {
         GameThread.Abort();
     }
     mediaPlayer.Close();
     if (partyPage != null)
     {
         if (partyPage.waveIn != null)
             partyPage.waveIn.StopRecording();
         if (partyPage.waveOut != null)
             partyPage.waveOut.Stop();
     }
     if (IsConnected)
     {
         try
         {
             Server.TerminateSession();
         }
         catch { }
     }
 }