ROOT
6.07/01
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
Namespaces
All Classes
Files
Release Notes
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
tutorials
net
pclient.C
Go to the documentation of this file.
1
void
pclient
(
int
niter = 100,
int
bsize
= 500000,
int
nsocks = 5)
2
{
3
// Client program to test parallel sockets.
4
//
5
// To run this demo do the following:
6
// - Open two windows
7
// - Start ROOT in all two windows
8
// - Execute in the first window: .x pserv.C
9
// - Execute in the second window: .x pclient.C
10
// If you want to run the pserv.C on a different host, just change
11
// "localhost" in the TPSocket ctor below to the desried hostname.
12
//Author: Fons Rademakers
13
14
// Open connection to server
15
TPSocket
*sock =
new
TPSocket
(
"localhost"
, 9090, nsocks);
16
//TPSocket *sock = new TPSocket("pcroot2", 9090, nsocks);
17
18
char
*buf =
new
char
[
bsize
];
19
memset(buf, 65,
bsize
);
20
21
sock->
Send
(niter,
bsize
);
22
23
// send data to server
24
for
(
int
i = 0; i < niter; i++) {
25
int
ret = sock->
SendRaw
(buf,
bsize
);
26
if
(ret < 0) {
27
printf
(
"error sending\n"
);
28
break
;
29
}
30
}
31
32
delete
sock;
33
delete
[] buf;
34
}
TPSocket::Send
Int_t Send(const TMessage &mess)
Send a TMessage object.
Definition:
TPSocket.cxx:492
TPSocket
Definition:
TPSocket.h:35
bsize
Int_t bsize[]
Definition:
SparseFit4.cxx:31
TPSocket::SendRaw
Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt)
Send a raw buffer of specified length.
Definition:
TPSocket.cxx:554
pclient
void pclient(int niter=100, int bsize=500000, int nsocks=5)
Definition:
pclient.C:1
printf
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)