BF2Statistics.Gamespy.GpspServer.Shutdown C# (CSharp) Метод

Shutdown() публичный Метод

Shutsdown the GPSP server and socket
public Shutdown ( ) : void
Результат void
        public void Shutdown()
        {
            // Stop accepting new connections
            base.IgnoreNewConnections = true;

            // Unregister events so we dont get a shit ton of calls
            GpspClient.OnDisconnect -= GpspClient_OnDisconnect;

            // Disconnected all connected clients
            foreach (GpspClient C in Clients.Values)
                C.Dispose(true);

            // clear clients
            Clients.Clear();

            // Shutdown the listener socket
            base.ShutdownSocket();

            // Tell the base to dispose all free objects
            base.Dispose();
        }

Usage Example

        /// <summary>
        /// Shutsdown all of the Gamespy Servers
        /// </summary>
        public static void Shutdown()
        {
            // Shutdown Login Servers
            ClientManager.Shutdown();
            SearchProvider.Shutdown();
            MasterServer.Shutdown();
            CDKeyServer.Shutdown();

            // Update status
            bIsRunning = false;

            // Trigger the OnShutdown Event
            Stopped();
        }
All Usage Examples Of BF2Statistics.Gamespy.GpspServer::Shutdown