public override void Terminate() { try { Trace.WriteLine("[AsyncTransmitter] Terminate"); // Block until we are done... // Let all endpoints finish the work they are doing before disposing them _controlledTermination.Terminate(); lock (_endpoints) { foreach (IAsyncTransmitterEndpoint endpoint in _endpoints.Values) { // clean up and potentially close any endpoints try { endpoint.Dispose(); } catch (Exception e) { TransportProxy.SetErrorInfo(e); } } } base.Terminate(); } finally { Dispose(); } }
public override void Terminate() { try { base.Terminate(); foreach (ReceiverEndpoint endpoint in _endpoints.Values) { endpoint.Dispose(); } _endpoints.Clear(); _endpoints = null; // Block until we are done... _control.Terminate(); } finally { Dispose(); } }