X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=8b75eea996f36717016d1b25f2d52d15e40aef26;hp=813a0890afe1e4da3a7e9efd49fa3bf79b510079;hb=298cf150958212e3270182644fd87f5489823b27;hpb=2bceba7f5162198834ca9f3dca0258e7eac1f797 diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 813a0890..8b75eea9 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -18,7 +18,6 @@ along with this program. If not, see . */ -#include #include #include #include @@ -28,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 { @@ -42,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 { @@ -78,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); }