Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Winboard problem (maybe Delphi only )

Author: Dann Corbit

Date: 17:40:06 08/22/03

Go up one level in this thread


On August 22, 2003 at 17:55:43, Tony Werten wrote:

>Hi all,
>
>I have found some strange problem in my engine wich only happens every now and
>then.
>
>Somewhere in the middle of a game, winboard will report "first engine (c:\xinix
>) exited unexpectedly".
>
>I have enabled my interface however and I see my engine is still running nicely,
>but winboard doesn't recieve it's output anymore ( Normally if I start writing
>to winboard without being started as a winboard engine it will immediately crash
>)
>
>If I press OK (in the winboard dialog with the error) I see my engine recieving
>a quit and it nicely quits.
>
>I use "read" to read from winboard and "writeln" with a "flush" to write. (Both
>from or to the standard in/out)
>
>Has anybody seen this happen before ? Is it possible to break an anonymous pipe
>in 1 direction only anyway ?
>
>cheers,
>
>Tony
>
>PS Delphi 5, windows xp

In C or C++, you need to turn ALL buffering OFF for standard in put and output.

In C:
setbuf(stdout, NULL);
setbuf(stdin, NULL);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stdin, NULL, _IONBF, 0);

In C++:
cout.rdbuf()->setbuf(NULL,0);
cin.rdbuf()->setbuf(NULL,0);

Probably, that is the problem.  I imagine that there is a way to turn off
buffering completely in Delphi, but I am not terribly familiar with the
language.





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.