9swampy / Telnet

Published on Nuget at https://www.nuget.org/packages/Telnet

Home Page:http://www.nugetmusthaves.com/Package/Telnet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove Console.Write() from TerminatedReadAsync

pascaltippelt opened this issue · comments

Hi!

I am develloping a console application using your library. I parse the return I get from sending a single command to a telnet server. But I don't want to see the response in the console:

private async Task<string> TerminatedReadAsync(Func<string, bool> isTerminated, TimeSpan timeout, int millisecondSpin)
{
var endTimeout = DateTime.Now.Add(timeout);
var s = string.Empty;
while (!isTerminated(s) && endTimeout >= DateTime.Now)
{
var read = await this.ReadAsync(TimeSpan.FromMilliseconds(millisecondSpin)).ConfigureAwait(false);
Console.Write(read);
s += read;
}
return s;
}

The string is returned anyway, so why always otput the response to the console?

May it be possible to remove this Console.Write() or make it optional?

Best regards

Pascal

@9swampy - Messaging you on this issue in case you don't have alerts for pull requests (seeing as you have been active on newly opened issues).
Looks like there's been some recent traction on this issue but no indication from you as to what you're looking for in terms of merging / releasing.
Once again, I'm personally really appreciative of your library and would be honored to make some meaningful contributions. Thanks again!

Just did it; included in the release 0.9.1 I've just pushed to Nuget.

Any problems, shout.