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; }
private void TelnetBufferRead() { String data = MyTelnetConnection?.Read(); if (data != null) { OnCommunicationEvent(this, new ONTEventArgs(ConnectionEventType.Read, data)); } }
internal void Reset() { if (!mainWorker.IsBusy) { mainWorker.RunWorkerAsync(); } if ((MyTelnetConnection != null) && (MyTelnetConnection.IsConnected())) { throw new Exception(); } }
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); } }