Revision 6bef5d95c9c192b6cb1ddcb0cc19ca28e897739d authored by Rene Brun on 06 April 2005, 15:56:14 UTC, committed by Rene Brun on 06 April 2005, 15:56:14 UTC
Template implementation should be in header files (especially when the template class contains a ClassDef). git-svn-id: http://root.cern.ch/svn/root/trunk@11511 27541ba8-7e3a-0410-8455-c3a389f83636
1 parent 854d6f8
authserv.C
//--------------------------------------------------
#include "TPServerSocket.h"
//
// This macro should be run together with authclient.C to test
// authentication between two remote ROOT sessions.
// Run first the authserv.C within a ROOT session on the server
// machine, eg. "srv.machi.ne"; authserv accepts as argument
// the port wher it starts listening (default 3000).
// You can then run authclient.c in a ROOT session on the client
// machine:
// root[] .x tutorials.C("srv.machi.ne:3000")
//
// and you should get prompted for the credentials, if the case.
// To start a parallel socket of size, for example, 5, enter the
// size as second argument, ie
//
// root[] .x tutorials.C("srv.machi.ne:3000",5)
//
int authserv(int po = 3000)
{
UChar_t oauth = kSrvAuth;
TServerSocket *ss = 0;
TSocket *s = 0;
cout << "authserv: starting a (parallel) server socket on port "
<< po << " with authentication" << endl;
ss = new TPServerSocket(po);
// Get the connection
s = ss->Accept(oauth);
// Print out;
if (s)
if (s->IsAuthenticated())
cout << "authserv: srv auth socket: OK" << endl;
else
cout << "authserv: srv auth socket: failed" << endl;
// Cleanup
if (s) delete s;
if (ss) delete ss;
}
//--------------------------------------------------
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...