ROOT logo

From $ROOTSYS/tutorials/net/pclient.C

void pclient(int niter = 100, int bsize = 500000, int nsocks = 5)
{
   // Client program to test parallel sockets.
   //
   // To run this demo do the following:
   //   - Open two windows
   //   - Start ROOT in all two windows
   //   - Execute in the first window: .x pserv.C
   //   - Execute in the second window: .x pclient.C
   // If you want to run the pserv.C on a different host, just change
   // "localhost" in the TPSocket ctor below to the desried hostname.
   //Author: Fons Rademakers
   
   // Open connection to server
   TPSocket *sock = new TPSocket("localhost", 9090, nsocks);
   //TPSocket *sock = new TPSocket("pcroot2", 9090, nsocks);

   char *buf = new char[bsize];
   memset(buf, 65, bsize);

   sock->Send(niter, bsize);

   // send data to server
   for (int i = 0; i < niter; i++) {
      int ret = sock->SendRaw(buf, bsize);
      if (ret < 0) {
         printf("error sending\n");
         break;
      }
   }

   delete sock;
   delete [] buf;
}
 pclient.C:1
 pclient.C:2
 pclient.C:3
 pclient.C:4
 pclient.C:5
 pclient.C:6
 pclient.C:7
 pclient.C:8
 pclient.C:9
 pclient.C:10
 pclient.C:11
 pclient.C:12
 pclient.C:13
 pclient.C:14
 pclient.C:15
 pclient.C:16
 pclient.C:17
 pclient.C:18
 pclient.C:19
 pclient.C:20
 pclient.C:21
 pclient.C:22
 pclient.C:23
 pclient.C:24
 pclient.C:25
 pclient.C:26
 pclient.C:27
 pclient.C:28
 pclient.C:29
 pclient.C:30
 pclient.C:31
 pclient.C:32
 pclient.C:33
 pclient.C:34
 pclient.C:35