Esempio n. 1
0
        private void DisposeConnection(Object stateInfo)
        {
            try
            {
                RemoteServerConnection connection = stateInfo as RemoteServerConnection;

                if (connection != null)
                {
                    connection.CloseSessions();

                    BeginCall();                        // sync here; we may be coming in on a remoting thread
                    try
                    {
                        _connections.SafeDisown(connection);
                    }
                    finally
                    {
                        EndCall();
                    }

                    connection.Dispose();
                }
            }
            catch
            {
                // Don't allow exceptions to go unhandled... the framework will abort the application
            }
        }
Esempio n. 2
0
        public void Relinquish(IRemoteServerConnection connection)
        {
            RemoteServerConnection localConnection = connection as RemoteServerConnection;

            localConnection.CloseSessions();

            BeginCall();
            try
            {
                _connections.SafeDisown(localConnection);
            }
            finally
            {
                EndCall();
            }
            try
            {
                localConnection.Dispose();
            }
            catch (Exception E)
            {
                throw WrapException(E);
            }
        }