From efc8fd9ff49bc24234d2143ff23df04cf42a02ee Mon Sep 17 00:00:00 2001 From: sham-404 Date: Sun, 10 May 2026 23:08:49 +0530 Subject: [PATCH] Fixed linux stdio buffering issues with uci communication protocol --- com.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/com.cpp b/com.cpp index 699cb5f..cdfbc80 100644 --- a/com.cpp +++ b/com.cpp @@ -66,7 +66,13 @@ int input() { #include "sys/select.h" int com_init() { + setvbuf(stdin, NULL, _IONBF, 0); + setvbuf(stdout, NULL, _IONBF, 0); + chronos.movetime = 5000; + chronos.flags = FMOVETIME; + + return 0; } int input() @@ -328,6 +334,7 @@ int com_uci(char * command) { int com_send(char * command) { printf("%s\n",command); + fflush(stdout); return 0; }