Example #1
0
        private void TelnetBufferWrite()
        {
            if (WriteBuffer == null)
            {
                return;
            }

            ConnectionEventType type = ConnectionEventType.Error;

            if (MyTelnetConnection.WriteLine(WriteBuffer))
            {
                if ((Input == CommandState.AcceptSLID) && (_slid == null))
                {
                    // wrote a slid manually set via the console
                    _slid = WriteBuffer;
                }

                type = ConnectionEventType.Write;
            }
            else
            {
                Input = CommandState.RejectAll;
            }

            OnCommunicationEvent(this, new ONTEventArgs(type, WriteBuffer));

            WriteBuffer = null;
        }
Example #2
0
        private void TelnetBufferRead()
        {
            String data = MyTelnetConnection?.Read();

            if (data != null)
            {
                OnCommunicationEvent(this, new ONTEventArgs(ConnectionEventType.Read, data));
            }
        }
Example #3
0
        internal void Reset()
        {
            if (!mainWorker.IsBusy)
            {
                mainWorker.RunWorkerAsync();
            }

            if ((MyTelnetConnection != null) && (MyTelnetConnection.IsConnected()))
            {
                throw new Exception();
            }
        }
Example #4
0
        private void TelnetInit()
        {
            if (MyTelnetConnection == null)
            {
                MyTelnetConnection = new TelnetConnection(
                    Settings.Default.ONTIPADDRESS,
                    Settings.Default.ONTPORT
                    );
            }
            else
            {
                MyTelnetConnection.Disconnect();
                MyTelnetConnection.Connect();
            }

            if (MyTelnetConnection.IsConnected())
            {
                OnConnectedEvent(this, null);
            }
        }