private async Task ReadAndSendEvent(bool FilterUnknownCommandOnPing = false) { ClientReadAsync = TelnetClient.ReadAsync(); await Task.WhenAll(ClientReadAsync); if (ClientReadAsync.Result != "") { if (FilterUnknownCommandOnPing) { string unknownCommandFilteredMessage = ClientReadAsync.Result.Replace("*** ERROR: unknown command 'ping'", ""); OnTelnetReceivedHandler?.Invoke(this, new OnTelnetReceivedEventArgs(unknownCommandFilteredMessage)); } else { OnTelnetReceivedHandler?.Invoke(this, new OnTelnetReceivedEventArgs(ClientReadAsync.Result)); } } //Console.Write(ClientReadAsync.Result); }