public void Dispose()
        {
            // TODO: Close opened channels?
            // Assuming so for the time being, but don't know how to send stop messages yet
            InputChannel.Dispose();
            // InputTvRemoteChannel.Dispose();

            TextChannel.Dispose();
            MediaChannel.Dispose();
            BroadcastChannel.Dispose();

            _sessionMessageTransport.Dispose();
            _messageTransport.Dispose();
        }
Esempio n. 2
0
        public new void Dispose()
        {
            if (running)
            {
                execute("rt.stop()");
                StopDaemon();
            }

            if (dc != null)
            {
                dc.Dispose();
            }
            base.Dispose();
        }
Esempio n. 3
0
        /// <inheritdoc />
        public override void Dispose()
        {
            InputChannel.NewOutMessage  -= InputChannelOnNewOutMessage;
            OutputChannel.NewOutMessage -= OutputChannelOnNewOutMessage;

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

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

            base.Dispose();
        }
Esempio n. 4
0
 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.");
         }
     }
 }
Esempio n. 5
0
        void IDisposable.Dispose()
        {
            InputChannel.NewOutMessage  -= InputChannelOnNewOutMessage;
            OutputChannel.NewOutMessage -= OutputChannelOnNewOutMessage;

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

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

            Adapter.NewOutMessage -= AdapterOnNewOutMessage;
            //Adapter.Dispose();
        }
Esempio n. 6
0
        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 { }
        }
        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    // TODO: Close opened channels?
                    // Assuming so for the time being, but don't know how to send stop messages yet
                    InputChannel.Dispose();
                    // InputTvRemoteChannel.Dispose();

                    TextChannel.Dispose();
                    MediaChannel.Dispose();
                    BroadcastChannel.Dispose();

                    _sessionMessageTransport.Dispose();
                    _messageTransport.Dispose();
                }
                _disposed = true;
            }
        }
Esempio n. 8
0
    protected void OnConnectionToggleToggled(object sender, EventArgs e)
    {
        bool active = connectionToggle.Active;

        if (active)
        {
            commandConnection = new PythonConnection(ipEntry.Text, userNameEntry.Text, passwordEntry.Text);

            // Open a separate data connection:
            // Has to be done before sending prep_code.py as it defines necessary variables for prep_code.py
            videoChannel = new InputChannel(commandConnection, ipEntry.Text, 4711);

            using (var sr = new System.IO.StreamReader("prep_code.py"))
            {
                String line;
                while ((line = sr.ReadLine()) != null)
                {
                    commandConnection.execute(line);
                }
            }
        }
        else
        {
            controlToggle.Active = false;
            cameraToggle.Active  = false;
            commandConnection.execute("close()");
            commandConnection.Dispose();
            videoChannel.Dispose();
            commandConnection = null;
            videoChannel      = null;
        }

        stiffnessToggle.Sensitive = active;
        cameraToggle.Sensitive    = active;
        ttsButton.Sensitive       = active;

        ipEntry.Sensitive       = !active;
        userNameEntry.Sensitive = !active;
        passwordEntry.Sensitive = !active;
    }