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:");
58 }
else if (arg ==
"halt") {
61 window->TerminateROOT();
136 auto pos =
fname.find(
"ping.cxx");
140 fname =
gROOT->GetTutorialsDir() + std::string(
"/webgui/ping/");
141 fname.append(
"ping.html");
142 window->SetDefaultPage(
"file:" +
fname);
145 window->SetGeometry(300, 500);
149 window->SetDataCallBack(ProcessData);
153 window->UseServerThreads();
156 window->StartThread();
162 std::cout <<
"Window url is: " << window->GetUrl(
true) << std::endl;
170 stop_tm = std::chrono::high_resolution_clock::now();
175 std::cout <<
"PING-PONG TEST COMPLETED " <<
round_trip;
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.