Client program which creates and fills a histogram.
Every 1000 fills the histogram is send to the server which displays the histogram.
To run this demo do the following:
- Open three windows
- Start ROOT in all three windows
- Execute in the first window: .x hserv.C (or hserv2.C)
- Execute in the second and third windows: .x hclient.C If you want to run the hserv.C on a different host, just change "localhost" in the TSocket ctor below to the desired hostname.
The script argument "evol" can be used when using a modified version of the script where the clients and server are on systems with different versions of ROOT. When evol is set to kTRUE the socket will support automatic schema evolution between the client and the server.
{
char str[32];
int idx = !strcmp(str, "go 0") ? 0 : 1;
if (idx == 1)
if (idx == 0) {
hpx =
new TH1F(
"hpx",
"This is the px distribution",100,-4,4);
} else {
hpx =
new TH2F(
"hpxpy",
"py vs px",40,-4,4,40,-4,4);
}
gRandom->SetSeed();
const int kUPDATE = 1000;
for (int i = 0; i < 25000; i++) {
gRandom->Rannor(px,py);
if (idx == 0)
else
if (i && (i%kUPDATE) == 0) {
}
}
if (cmesslen > 0)
printf("Average compression ratio: %g\n", messlen/cmesslen);
}
- Author
- Fons Rademakers
Definition in file hclient.C.