Author: Fabien Letouzey
Date: 02:43:24 04/14/04
Go up one level in this thread
On April 14, 2004 at 05:31:33, Sune Fischer wrote: >On April 13, 2004 at 07:08:19, Fabien Letouzey wrote: > >> >>Hello, >> >>I have a request for all engine authors. Please let the engine quit >>when end-of-file is read on input. This applies to xboard, UCI and >>even console engines. >> >>I know the engine is supposed to receive "quit" first in both xboard >>and UCI, but the interface (whether graphical or not) might crash or >>get killed or whatever. If end-of-file is received, how are you going >>to get new commands??? >> >>I guess most engines use fgets() to read input, just test the return >>value for NULL. Technically is could be an error or end-of-file then, >>you can use ferror() and feof() if you wish to distinguish. If you >>use read() or the like then 0 means EOF was reached. >Testing for NULL doesn't seem to work, it still hangs when the GUI crashes. Do you feel like investigating? That suggests that the pipe is not closed even after the creator died?! I think we could learn something from understanding this. E.g. launching PolyGlot in a console, then killing it using the task manager. It should work IMO, but my Windows knowledge is rather limited. >Perhaps I'm doing it wrong, should it be if (stdin==NULL)? No, just fgets() return value as you did. Fabien.
This page took 0.01 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.