19std::shared_ptr<ROOT::RWebWindow> window;
27auto start_tm = std::chrono::high_resolution_clock::now();
32void ProcessData(
unsigned connid,
const std::string &arg)
34 if (arg.find(
"PING:") == 0) {
35 window->Send(connid, arg);
36 }
else if (arg ==
"first") {
38 firstmsg_tm = std::chrono::high_resolution_clock::now();
39 std::vector<std::string> clients;
43 clients.emplace_back(
".." + window->GetUrl(
false));
45 }
else if (arg.find(
"SHOW:") == 0) {
46 std::string
msg = arg.substr(5);
48 std::cout <<
msg << std::endl;
49 if (
msg.find(
"Cnt:") == 0) {
50 int counter = std::stoi(
msg.substr(4));
55 auto p =
msg.find(
"round-trip:");
59 }
else if (arg ==
"halt") {
62 window->TerminateROOT();
138 auto pos =
fname.find(
"ping.cxx");
142 fname =
gROOT->GetTutorialsDir() + std::string(
"/visualisation/webgui/ping/");
143 fname.append(
"ping.html");
144 window->SetDefaultPage(
"file:" +
fname);
147 window->SetGeometry(300, 500);
151 window->SetDataCallBack(ProcessData);
155 window->UseServerThreads();
158 window->StartThread();
164 std::cout <<
"Window url is: " << window->GetUrl(
true) << std::endl;
171 window->WaitFor([=](
double tm) {
176 stop_tm = std::chrono::high_resolution_clock::now();
181 std::cout <<
"PING-PONG TEST COMPLETED " <<
round_trip;
186 <<
" run: " <<
runttime_int.count() <<
"ms" << std::endl;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
static std::shared_ptr< RWebWindow > Create()
Create new RWebWindow Using default RWebWindowsManager.
static void SetSingleConnMode(bool on=true)
Enable or disable single connection mode (default on) If enabled, one connection only with any web wi...
static TString ToJSON(const T *obj, Int_t compact=0, const char *member_name=nullptr)
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.