Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to filter out remote echo of my commands #75

Open
arkypita opened this issue Jul 17, 2023 · 1 comment
Open

How to filter out remote echo of my commands #75

arkypita opened this issue Jul 17, 2023 · 1 comment

Comments

@arkypita
Copy link

Hi all, this is not an issue but an help request from you experts.

When I connect to my telnet server (linux telnetd from busybox 1.36) I have all my chars echoed back from te server, and from the tests I've done there doesn't seem to be a way to turn this behavior off.

This causes me that when I send a command, and I want to read the result of this command, i found the command itself in the return value of TerminatedReadAsync

await telnet.WriteLineAsync("pwd");
string serverResponse = await telnet.TerminatedReadAsync("$", TimeSpan.FromMilliseconds(2000));
Debug.WriteLine(serverResponse);

--- debug output ---
pwd
/home/arkypita
@box:~$

Is there a way to filter out the echo, other than trivially removing the command from the response serverResponse.replace("pwd", "")?

@9swampy
Copy link
Owner

9swampy commented Apr 17, 2024

I've just been bumping the dependencies and adding in a Net8 target but gave this a go too while publishing 0.12. I've extended the Client ctor to additionally accept options to send during negotiation. Depending on your setup if you send Dont Echo or Do SuppressLocalEcho it may sort your issue.

Let me know if it helps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants