29 Jul, 2011, Mastermosley wrote in the 1st comment:
Votes: 0
Is there away to detect if I am dealing with a telnet client like the stock windows client? I would like to support them with backspace but the only way to do this is by turning echo off and writing all of the bytes back to client. The problem with this is I don't want to echo back to a mud client as it will cause repeated data. Any ideas?
29 Jul, 2011, Mastermosley wrote in the 2nd comment:
Votes: 0
Wait, I guess I could check if the incomming byte[] buffer is a single byte, if more than a single byte is recieved then obviously it was sent from a modern client (I dont no the terminology for a client that doesn't relay every byte back). Still being able to detect the clients would be usefull.
29 Jul, 2011, Twisol wrote in the 3rd comment:
Votes: 0
Mastermosley said:
Wait, I guess I could check if the incomming byte[] buffer is a single byte, if more than a single byte is recieved then obviously it was sent from a modern client (I dont no the terminology for a client that doesn't relay every byte back). Still being able to detect the clients would be usefull.

TCP doesn't guarantee that one send() corresponds to one recv(). If you send three bytes, the remote end might end up receiving one, two, or three packets. In practice you rarely see splintering of small amounts of data, but that doesn't mean it's not impossible. You never know what might be sitting between you and the user changing things, so it's not a portable solution.

KaVir had some kind of time-based mechanism to detect Windows Telnet. Strictly speaking, that's not portable either, but it's at the Telnet level rather than the TCP level.
29 Jul, 2011, KaVir wrote in the 4th comment:
Votes: 0
Twisol said:
KaVir had some kind of time-based mechanism to detect Windows Telnet.

I described it in more detail here.
29 Jul, 2011, Mastermosley wrote in the 5th comment:
Votes: 0
Quote
It is possible to identify whether Windows Telnet is being used, by requesting the value of the SYSTEMTYPE variable through the NEW-ENVIRON negotiation option. But engaging in negotiation to know whether to avoid using it, defeats the point.


Thats exactly what I am looking for. Although I am a little confused why we dont want to negotiate with it. I realize negotiations automatically turn echo off, but a simple if statement can determine whether to write the byte back?
29 Jul, 2011, Twisol wrote in the 6th comment:
Votes: 0
Well, if you want to turn echo off for Windows Telnet… that's perfect!
29 Jul, 2011, KaVir wrote in the 7th comment:
Votes: 0
Mastermosley said:
Thats exactly what I am looking for. Although I am a little confused why we dont want to negotiate with it. I realize negotiations automatically turn echo off, but a simple if statement can determine whether to write the byte back?

If you plan to use character mode anyway then it doesn't matter. I don't wish to support character mode though, and I also don't want to switch off echo - therefore I avoid negotiating with the client until I'm sure it's not Windows telnet.
29 Jul, 2011, Scandum wrote in the 8th comment:
Votes: 0
Mastermosley said:
Thats exactly what I am looking for. Although I am a little confused why we dont want to negotiate with it. I realize negotiations automatically turn echo off, but a simple if statement can determine whether to write the byte back?

You're correct. My MTH telnet snippet uses NEW-ENVIRON to detect Windows telnet. http://www.mudbytes.net/index.php?a=file...

Remote echoing can be handled as following in a merc-like codebase, with an extra check to write a * when the user is entering a password:

nRead = read(d->descriptor, bufin, MAX_INPUT_LENGTH);

if (nRead > 0)
{
nCurr = d->intop;

d->intop += translate_telopts(d, bufin, nRead, d->inbuf + d->intop);

if (IS_SET(d->comm_flags, COMM_FLAG_REMOTEECHO))
{
for (nSkip = nCurr ; nSkip < d->intop ; nSkip++)
{
switch (d->inbuf[nSkip])
{
case 8:
case 127:
d->inbuf[nSkip] = '\b';
write(d->descriptor, "\b \b", 3);
break;

case '\n':
write(d->descriptor, "\r\n", 2);
break;

default:
if (HAS_BIT(d->comm_flags, COMM_FLAG_PASSWORD))
{
write(d->descriptor, "*", 1);
}
else
{
write(d->descriptor, d->inbuf + nSkip, 1);
}
break;
}
}
}
29 Jul, 2011, Vigud wrote in the 9th comment:
Votes: 0
Quote
Remote echoing can be handled as following in a merc-like codebase, with an extra check to write a * when the user is entering a password:
How does it play with rlwrap?
29 Jul, 2011, Scandum wrote in the 10th comment:
Votes: 0
It's only enabled for windows telnet, proper telnet clients stay in local echo mode.
0.0/10