This is test suite for RWebWindow communication performance On the first place latency of round-trip (ping-pong) packet is measured File ping.cxx implements server-side code of RWebWindow In ping.html client code plus visualization is provided.
#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();
window->Send(connid, std::string(
"CLIENTS:") + std::to_string(
num_clients));
} 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.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;
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.
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.