X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=4aa0136e4e25fc08873446a6eb608b736a2172ee;hp=1c6ef777257dda39e24753674f801ddbbe905d0d;hb=335e376866befa9878c488c9f525bb87af88f544;hpb=e6438f46fc655dca2413b02921e30546d762c72e diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 1c6ef777..4aa0136e 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -27,11 +27,13 @@ #include "thread.h" #include "tt.h" #include "uci.h" +#include "hashprobe.h" #include "syzygy/tbprobe.h" using std::string; UCI::OptionsMap Options; // Global object +std::unique_ptr hash_probe_thread; namespace UCI { @@ -41,7 +43,13 @@ void on_hash_size(const Option& o) { TT.resize(o); } void on_logger(const Option& o) { start_logger(o); } void on_threads(const Option& o) { Threads.set(o); } void on_tb_path(const Option& o) { Tablebases::init(o); } - +void on_rpc_server_address(const Option& o) { + if (hash_probe_thread) { + hash_probe_thread->Shutdown(); + } + std::string addr = o; + hash_probe_thread.reset(new HashProbeThread(addr)); +} /// Our case insensitive less() function as required by UCI protocol bool CaseInsensitiveLess::operator() (const string& s1, const string& s2) const { @@ -77,6 +85,7 @@ void init(OptionsMap& o) { o["SyzygyProbeDepth"] << Option(1, 1, 100); o["Syzygy50MoveRule"] << Option(true); o["SyzygyProbeLimit"] << Option(7, 0, 7); + o["RPCServerAddress"] << Option("", on_rpc_server_address); }