Client program which creates and fills a histogram.
Every 1000 fills the histogram is send to the server which displays the histogram.
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.
{
delete resolver;
printf(
"ConnectToServer: host = %s, port = %d\n", host.
GetHostName(), port);
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);
}
for (int i = 0; i < 25000; i++) {
if (idx == 0)
else
mess.Reset();
mess.WriteObject(hpx);
messlen += mess.Length();
cmesslen += mess.CompLength();
}
}
if (cmesslen > 0)
printf("Average compression ratio: %g\n", messlen/cmesslen);
}
void UpdateBonjourRecords(
TList *records)
{
printf("UpdateBonjourRecords (resolved = %s)\n", resolved ? "kTRUE" : "kFALSE");
if (resolved) return;
resolver->
Connect(
"RecordResolved(TInetAddress*,Int_t)", 0, 0,
"ConnectToServer(TInetAddress*,Int_t)");
}
}
}
{
gEvo = evol;
browser->
Connect(
"CurrentBonjourRecordsChanged(TList*)", 0, 0,
"UpdateBonjourRecords(TList*)");
}
R__EXTERN TBenchmark * gBenchmark
R__EXTERN void * gTQSender
R__EXTERN TRandom * gRandom
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual void Start(const char *name)
Starts Benchmark with the specified name.
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Int_t BrowseForServiceType(const char *serviceType)
Tell Bonjour to start browsing for a specific type of service.
const char * GetReplyDomain() const
void Print(Option_t *opt="") const
Print TBonjourRecord.
const char * GetRegisteredType() const
Int_t ResolveBonjourRecord(const TBonjourRecord &record)
Resolve Bonjour service to IP address and port.
1-D histogram with a float per channel (see TH1 documentation)}
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
2-D histogram with a float per channel (see TH1 documentation)}
This class represents an Internet Protocol (IP) address.
const char * GetHostName() const
static void EnableSchemaEvolutionForAll(Bool_t enable=kTRUE)
Static function enabling or disabling the automatic schema evolution.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual void Rannor(Float_t &a, Float_t &b)
Return 2 numbers distributed following a gaussian with mean=0 and sigma=1.
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
See comments for function SetCompressionSettings.
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
virtual void Close(Option_t *opt="")
Close the socket.
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.