Beispiel #1
0
        public void Close()
        {
            if (_transport != null)
            {
                _transport.Close();
            }

            lock (_waitingOperations)
            {
                foreach (var operation in _waitingOperations)
                {
                    operation.Value.Abort();
                }
                _waitingOperations.Clear();
            }
        }
Beispiel #2
0
        public void Close()
        {
            if (_transport != null)
            {
                _transport.Close();
            }

            //Abort remaining WaitingOperations
            List <WaitingOperationDescriptor> operationsToAbort = null;

            lock (_waitingOperations)
            {
                operationsToAbort = new List <WaitingOperationDescriptor>(_waitingOperations.Values);
                _waitingOperations.Clear();
            }
            foreach (var operation in operationsToAbort)
            {
                operation.Abort();
            }
        }