Markus Enzenberger wrote:
Sometimes it is necessary to interrupt certain commands like genmove.
...
It checks the next character of the input stream for ETX and puts it back, if it is another character.
This forces the engine to poll the input stream and/or to use non-blocking I/O. (BTW your method will fail if the 003 is not the first character in the input stream.) TCP/IP allows "out of band data" for this purpose. Telnet uses this feature to deliver the ^C to the terminal-driver (which generates an interrupt) Strictly speaking, this is not a text-command. It will be hard to implement it in a portable way. Some engines may not like it. But maybe we should just standardise (some) of the semantics, and leave the implementation to the engine/gtp-driver - programmer. Given the OOB nature of the command, it's syntax already is standardised :-)
AvK