Loading [MathJax]/extensions/tex2jax.js
ROOT
6.08/07
Reference Guide
ROOT Home Page
Main Page
Tutorials
User's Classes
+
Namespaces
Namespace List
+
Namespace Members
+
All
2
3
<
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
<
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
2
3
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
u
v
x
+
Enumerations
a
d
e
f
g
h
m
p
t
v
w
y
+
Enumerator
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
u
v
w
+
All Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
x
y
+
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
w
y
+
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Properties
f
+
Related Functions
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Files
File List
+
File Members
+
All
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Enumerations
c
e
f
i
l
m
p
r
u
x
+
Enumerator
a
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
v
w
x
y
z
+
Macros
1
2
3
4
5
6
7
8
9
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
tutorials
net
authserv.C
Go to the documentation of this file.
1
/// \file
2
/// \ingroup tutorial_net
3
/// This macro should be run together with authclient.C to test
4
/// authentication between two remote ROOT sessions.
5
/// Run first the authserv.C within a ROOT session on the server
6
/// machine, eg. "srv.machi.ne":
7
///
8
/// root[] .x authserv.C(3000)
9
///
10
/// authserv accepts as argument the port where it starts listening
11
/// (default 3000).
12
/// You can then run authclient.c in a ROOT session on the client
13
/// machine:
14
///
15
/// root[] .x authclient.C("srv.machi.ne:3000")
16
///
17
/// and you should get prompted for the credentials, if the case.
18
/// To start a parallel socket of size, for example, 5, enter the
19
/// size as second argument, ie
20
///
21
/// root[] .x authclient.C("srv.machi.ne:3000",5)
22
///
23
///
24
/// \macro_code
25
///
26
/// \author
27
28
#include "
TPServerSocket.h
"
29
30
int
authserv(
int
po = 3000)
31
{
32
33
UChar_t
oauth =
kSrvAuth
;
34
35
TServerSocket
*ss = 0;
36
TSocket
*s = 0;
37
38
cout <<
"authserv: starting a (parallel) server socket on port "
39
<< po <<
" with authentication"
<< endl;
40
41
ss =
new
TPServerSocket
(po);
42
43
// Get the connection
44
s = ss->
Accept
(oauth);
45
46
// Print out;
47
if
(s)
48
if
(s->
IsAuthenticated
())
49
cout <<
"authserv: srv auth socket: OK"
<< endl;
50
else
51
cout <<
"authserv: srv auth socket: failed"
<< endl;
52
53
// Cleanup
54
if
(s)
delete
s;
55
if
(ss)
delete
ss;
56
}
57
TServerSocket
Definition:
TServerSocket.h:44
TServerSocket::Accept
virtual TSocket * Accept(UChar_t Opt=0)
Accept a connection on a server socket.
Definition:
TServerSocket.cxx:204
kSrvAuth
const UChar_t kSrvAuth
Definition:
TServerSocket.h:41
TSocket
Definition:
TSocket.h:76
TSocket::IsAuthenticated
virtual Bool_t IsAuthenticated() const
Definition:
TSocket.h:161
TPServerSocket.h
TPServerSocket
Definition:
TPServerSocket.h:35
UChar_t
unsigned char UChar_t
Definition:
RtypesCore.h:34