Exemple #1
0
        /// <summary>
        /// Handle the stop server event.
        /// </summary>
        private void stopServer()
        {
            CSMessage msg = new CSMessage(MessageType.DECONNECTION);

            broadcast(msg);

            foreach (UserThread cl in clients)
            {
                cl.stop();
            }

            clients.Clear();

            if (ps.isStarted())
            {
                ps.stop();
            }
            if (view != null && view.isOpened())
            {
                view.clearAll();
                view.updateState(ps.isStarted());
                ServerThread.initCounter();
            }
            else
            {
                manager.close();
            }
        }