/// <summary>
    /// Stop everything.
    /// </summary>

    void Disconnect()
    {
        mGame.Stop();

        if (mLobby != null)
        {
            mLobby.Stop();
            mLobby = null;
        }
        mUp.Close();
    }
Esempio n. 2
0
    /// <summary>
    /// Stop the server.
    /// </summary>

    public void Dispose()
    {
        // Stop the game server
        if (mGameServer != null)
        {
            mGameServer.Stop();
            mGameServer = null;
        }

        // Stop the lobby server
        if (mLobbyServer != null)
        {
            mLobbyServer.Stop();
            mLobbyServer = null;
        }

        // Close all opened ports
        if (mUPnP != null)
        {
            mUPnP.Close();
            mUPnP.WaitForThreads();
            mUPnP = null;
        }
    }