bug-gnu-chess
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Flushing output and GUI


From: Nickolay V. Shmyrev
Subject: Flushing output and GUI
Date: Mon, 03 May 2004 20:11:36 +0400

Hello, I am writing a small GUI to gnuchess (like XBoard, but with mono
and gtk-sharp). I've meet some problems. The gnuchess is quite usable,
unless there is problem with output. The output is not flushed
sometimes.

For example, if I send command show board, I can't read it's output
until I send something like "give me it"

That is how I read commands from gnuchess



          protected ArrayList Get (int count) {
                                                                                
              ArrayList result = new ArrayList ();
                                                                                
              // This is used because gnuchess doesn't properly flush 
                   // output
                                                                                
              input.WriteLine ("give me it");
              for (int i = 0; i < count; i++)
                {
                  result.Add (output.ReadLine());
                }
                                                                                
              // This to
              output.ReadLine ();
                                                                                
              return result;
           }
                                                                                
          protected void Put (string text) {
                     input.WriteLine (text);
          }

Also, greeting and information about hash on the start are not flushed
too. 
Could you improve the the handling of such moments?



Regards.

                                                Shmyrev.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]