X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fucioption.cpp;h=ea370106fef273723e5f931c1ab1bf6cbeb37b0e;hp=23c0c4805b816ab801f1a04acbfd65d28efd3058;hb=d4062bbfa6c71e23fc6fb3f04e043409e8e41df7;hpb=fcee0ce6a39a28ffdfa4b1ed438b353a895edb6b diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 23c0c480..ea370106 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(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 { @@ -80,6 +88,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); }