X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=5982f26a14832c6817f0a303a2b7022b5dfc1abc;hp=ef54ef4e5be50f9fb2b0c535a2546815ea407b20;hb=a24f28be8567c2527b154ef981090368a2bd8f76;hpb=9587eeeb5ed29f834d4f956b92e0e732877c47a7 diff --git a/src/ucioption.cpp b/src/ucioption.cpp index ef54ef4e..5982f26a 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -28,11 +28,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 { @@ -42,7 +44,13 @@ void on_hash_size(const Option& o) { TT.resize(size_t(o)); } void on_logger(const Option& o) { start_logger(o); } void on_threads(const Option& o) { Threads.set(size_t(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 { @@ -79,6 +87,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); }