Re: Ansi color detection ... little problem.

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 05/31/02


On Fri, 31 May 2002, Bryan Donlan wrote:

> It's impossible. TCP is asyncronous, so anything send does not always
> get responded to immediately. Try waiting a few secs after sending the
> codes, then checking for a response.

Latency notwithstanding, TELNET, which is a protocol over TCP, is, by
default, line-oriented.  As someone else suggested, you can switch into
character at a time mode using the SGA TELNET option.  However, if you're
going to be implementing support for TELNET options, then there's no need
to go this route.  TELNET allows you to negotiation on terminal type and
you'd be better suited to implement this instead of negotiation on the SGA
option.

Another idea would be to parse the name input string to strip out the
terminal's response code.  This allows you to stay in line at a time mode,
but still get the terminal's response.  The disadvantage is that you
cannot determine the user's terminal type until he's entered his name, so
your introduction screen cannot take advantage of terminal options.

Unless you're familiar with the TELNET protocol and have done protocol
implementations before, I would recommend the latter, simpler approach to
autodetection.

-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT