Beispiel #1
0
        /// <inheritdoc />
        public override void Dispose()
        {
            InputChannel.NewOutMessage  -= InputChannelOnNewOutMessage;
            OutputChannel.NewOutMessage -= OutputChannelOnNewOutMessage;

            if (OwnInputChannel)
            {
                InputChannel.Dispose();
            }

            if (OwnOutputChannel)
            {
                OutputChannel.Dispose();
            }

            base.Dispose();
        }
 protected void Disposing(bool dispose)
 {
     if (dispose & !disposed)
     {
         disposed = true;
         try
         {
             InputFilters.Clear();
             OutputFilters.Clear();
             InputChannel.Dispose();
             OutputChannel.Dispose();
         }
         catch (Exception ex)
         {
             logger?.LogError(ex, "Fault disposing vrtu pipeline.");
         }
     }
 }
        void IDisposable.Dispose()
        {
            InputChannel.NewOutMessage  -= InputChannelOnNewOutMessage;
            OutputChannel.NewOutMessage -= OutputChannelOnNewOutMessage;

            if (OwnInputChannel)
            {
                InputChannel.Dispose();
            }

            if (OwnOutputChannel)
            {
                OutputChannel.Dispose();
            }

            Adapter.NewOutMessage -= AdapterOnNewOutMessage;
            //Adapter.Dispose();
        }
        private void Input_OnError(object sender, ChannelErrorEventArgs e)
        {
            logger?.LogError(e.Error, "Fault in input channel.");
            logger?.LogWarning("Shutting down channels in pipeline.");

            //dispose both channels
            outputDisposed = true;

            try
            {
                InputChannel.Dispose();
            }
            catch { }

            try
            {
                OutputChannel.Dispose();
            }
            catch { }
        }