BF2Statistics.Gamespy.MasterClient.Dispose C# (CSharp) Method

Dispose() public method

public Dispose ( ) : void
return void
        public void Dispose()
        {
            if (!Disposed)
                Dispose(false);
        }

Same methods

MasterClient::Dispose ( bool DisposeEventArgs = false ) : void

Usage Example

        /// <summary>
        /// Callback for when a connection had disconnected
        /// </summary>
        private void MasterClient_OnDisconnect(MasterClient client)
        {
            // Remove client, and call OnUpdate Event
            try
            {
                // Release this stream's AsyncEventArgs to the object pool
                base.Release(client.Stream);

                // Remove client from online list
                if (Clients.TryRemove(client.ConnectionId, out client) && !client.Disposed)
                {
                    client.Dispose();
                }
            }
            catch (Exception e)
            {
                Program.ErrorLog.Write("An Error occured at [MasterServer.OnDisconnect] : Generating Exception Log");
                ExceptionHandler.GenerateExceptionLog(e);
            }
        }
All Usage Examples Of BF2Statistics.Gamespy.MasterClient::Dispose