Test suite for RWebWindow communication performance.
#include <iostream>
#include <chrono>
std::shared_ptr<ROOT::RWebWindow> window;
auto start_tm = std::chrono::high_resolution_clock::now();
void ProcessData(unsigned connid, const std::string &arg)
{
if (arg.find("PING:") == 0) {
window->Send(connid, arg);
} else if (arg == "first") {
firstmsg_tm = std::chrono::high_resolution_clock::now();
std::vector<std::string> clients;
clients.emplace_back(".." + window->GetUrl(false));
} else if (arg.find("SHOW:") == 0) {
std::string
msg = arg.substr(5);
std::cout <<
msg << std::endl;
if (
msg.find(
"Cnt:") == 0) {
int counter = std::stoi(
msg.substr(4));
if (counter > 0)
}
auto p =
msg.find(
"round-trip:");
} else if (arg == "halt") {
window->TerminateROOT();
}
}
};
};
{
auto pos =
fname.find(
"ping.cxx");
if (pos > 0)
else
fname =
gROOT->GetTutorialsDir() + std::string(
"/visualisation/webgui/ping/");
fname.append(
"ping.html");
window->SetDefaultPage(
"file:" +
fname);
window->SetGeometry(300, 500);
window->SetDataCallBack(ProcessData);
window->UseServerThreads();
window->StartThread();
else
std::cout << "Window url is: " << window->GetUrl(true) << std::endl;
window->WaitFor([=](
double tm) {
? 1
: 0;
});
stop_tm = std::chrono::high_resolution_clock::now();
std::cout <<
"PING-PONG TEST COMPLETED " <<
round_trip;
else
}
}
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.