[comp.unix.questions] Questions about telnet:

sisley@milton.u.washington.edu (David Barr) (03/09/91)

        I need some help getting a program of mine to work.  The
program is a BBS server.  There is no client program, people can
connect to it using the telnet program.  One of the only problems that
I have is that I cannot figure out how to determine the status of the
telnet program which is accessing the BBS.  I can't tell whether it is
in line mode or character mode or echo mode, and I don't know how to
switch the modes.  I figured out that when the program is in character
mode, a carriage return will send a CR.  In line mode, the return key
sends a CR-LF.  So to read a line, I just keep reading from the socket
until I get a CR.  Then I try to read one more character, and I know
which mode I am in by whether or not the character is a LF.  I find
this solution to be inadequate, though, and I'd like to be able to
switch from line mode into character mode and be able to turn the
echoing on and off.
        Is anyone familiar with the solution to my problem?  I've
already looked over the source code to telnet, but it wasn't helpful.
Please direct any replies to this message through e-mail to:

David Barr
sisley@u.washington.edu