78 :
TNamed(addr.GetHostName(), service), fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
105 gROOT->GetListOfSockets()->Add(
this);
123 :
TNamed(addr.GetHostName(),
""), fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
151 gROOT->GetListOfSockets()->Add(
this);
166 :
TNamed(host, service), fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
192 gROOT->GetListOfSockets()->Add(
this);
211 :
TNamed(
TUrl(url).GetHost(),
""), fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
242 gROOT->GetListOfSockets()->Add(
this);
254 fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
277 gROOT->GetListOfSockets()->Add(
this);
304 gROOT->GetListOfSockets()->Add(
this);
315 fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
338 gROOT->GetListOfSockets()->Add(
this);
365 gROOT->GetListOfSockets()->Add(
this);
397 gROOT->GetListOfSockets()->Remove(
this);
468 if ((nsent =
Send(mess)) < 0)
487 if ((nsent =
Send(mess)) < 0)
506 if ((nsent =
Send(mess)) < 0)
509 return nsent -
sizeof(
Int_t);
529 Error(
"Send",
"cannot send a message used for reading");
547 char *mbuf = mess.
Buffer();
581 if (strncmp(buf,
"ok", 2)) {
582 Error(
"Send",
"bad acknowledgement");
591 return nsent -
sizeof(
UInt_t);
608 if ((nsent =
Send(mess)) < 0)
661 minilist =
new TList();
663 Info(
"SendStreamerInfos",
"sending TStreamerInfo: %s, version = %d",
673 if (
Send(messinfo) < 0)
674 Warning(
"SendStreamerInfos",
"problems sending TStreamerInfo's ...");
691 for (
Int_t ipid = 0; ipid < npids; ipid++) {
705 minilist =
new TList();
707 Info(
"SendProcessIDs",
"sending TProcessID: %s", pid->
GetTitle());
714 if (
Send(messpid) < 0)
715 Warning(
"SendProcessIDs",
"problems sending TProcessID's ...");
732 if ((
n =
Recv(str, max, kind)) <= 0) {
741 Error(
"Recv",
"got message of wrong kind (expected %d, got %d)",
761 if ((
n =
Recv(mess)) <= 0) {
794 if ((
n =
Recv(mess)) <= 0) {
831 if (
n == 0 ||
n == -5) {
841 char *buf =
new char[len+
sizeof(
UInt_t)];
843 if (
n == 0 ||
n == -5) {
867 char ok[2] = {
'o',
'k' };
902 if (length == 0)
return 0;
907 if (
n == 0 ||
n == -5) {
938 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
942 Info(
"RecvStreamerInfos",
"importing TStreamerInfo: %s, version = %d",
952 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
956 Info(
"RecvStreamerInfos",
"importing TStreamerInfo: %s, version = %d",
983 TIter nextpid(pidslist);
994 Info(
"RecvProcessIDs",
"importing TProcessID: %s", pid->
GetTitle());
1061 if (level < 0) level = 0;
1062 if (level > 99) level = 99;
1113 }
else if (sproto.
Contains(
"rootd")) {
1115 }
else if (sproto.
Contains(
"proofd")) {
1120 if (!strncasecmp(opt,
"S", 1)) {
1121 if (
Send(
"slave") < 0)
return rc;
1122 }
else if (!strncasecmp(opt,
"M", 1)) {
1123 if (
Send(
"master") < 0)
return rc;
1126 "called by TSlave: unknown option '%c' %s",
1127 opt[0],
" - assuming Slave");
1128 if (
Send(
"slave") < 0)
return rc;
1132 Info(
"Authenticate",
"Local protocol: %s",sproto.
Data());
1178 gROOT->GetPluginManager()->FindHandler(
"TVirtualAuth", alib);
1179 if (!
h ||
h->LoadPlugin() != 0) {
1180 Error(
"Authenticate",
1181 "could not load properly %s authentication plugin", alib.
Data());
1188 Error(
"Authenticate",
"could not instantiate the interface class");
1192 Info(
"Authenticate",
"class for '%s' authentication loaded", alib.
Data());
1196 Error(
"Authenticate",
1197 "authentication attempt failed for %s@%s", user, host.
Data());
1207 Warning(
"Authenticate",
"problem sending kROOTD_USER (%s,%s)", u->
fUser.
Data(), user);
1211 Warning(
"Authenticate",
"problem sending kROOTD_USER (-1,%s)", user);
1217 if (
Recv(stat, kind) > 0) {
1228 Info(
"Authenticate",
"no authentication required remotely");
1234 Info(
"Authenticate",
"expected message type %d, received %d",
1239 Info(
"Authenticate",
"error receiving message");
1304 if (
proto.EndsWith(
"up") ||
proto.EndsWith(
"ug")) {
1308 }
else if (
proto.EndsWith(
"s") ||
proto.EndsWith(
"k") ||
1309 proto.EndsWith(
"g") ||
proto.EndsWith(
"h")) {
1316 if (((
proto.EndsWith(
"p") || size > 1) &&
1317 !
proto.BeginsWith(
"proof")) ||
1318 proto.BeginsWith(
"root") ) {
1320 if (
proto.EndsWith(
"p"))
1325 if (!
proto.BeginsWith(
"sock") && !
proto.BeginsWith(
"proof") &&
1326 !
proto.BeginsWith(
"root"))
1341 if (opensock && opensock->
IsValid())
1347 if (sock && sock->
IsValid()) {
1370 if (opensock && opensock->
IsValid())
1441 if (
TString(
TUrl(url).GetProtocol()).Length() > 0) {
1446 if (!user || strlen(user) > 0) {
1454 eurl += (port > 0 ? port : 0);
UShort_t net2host(UShort_t x)
R__EXTERN const char * gRootdErrStr[]
unsigned long long ULong64_t
TVirtualMutex * gSocketAuthMutex
char * Form(const char *fmt,...)
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD2(mutex)
Bool_t TestBitNumber(UInt_t bitnumber) const
void SetBitNumber(UInt_t bitnumber, Bool_t value=kTRUE)
TObject * ReadObject(const TClass *cl) override
Read object from I/O buffer.
void WriteString(const char *s) override
Write string to I/O buffer.
char * ReadString(char *s, Int_t max) override
Read string from I/O buffer.
void WriteObject(const TObject *obj, Bool_t cacheReuse=kTRUE) override
Write object to I/O buffer.
virtual Int_t GetEntries() const
This class represents an Internet Protocol (IP) address.
const char * GetHostName() const
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual TObjLink * FirstLink() const
virtual void Clear(Option_t *option="")
Remove all objects from the list.
void SetLength() const
Set the message length at the beginning of the message buffer.
Bool_t TestBitNumber(UInt_t bitnumber) const
char * CompBuffer() const
Int_t Compress()
Compress the message.
Int_t GetCompressionLevel() const
void SetWhat(UInt_t what)
Using this method one can change the message type a-posteriori In case you OR "what" with kMESS_ACK,...
The TNamed class is the base class for all named ROOT classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * GetTitle() const
Returns title of object.
virtual const char * GetName() const
Returns name of object.
Int_t IndexOf(const TObject *obj) const
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * UncheckedAt(Int_t i) const
TObject * At(Int_t idx) const
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
Collectable string class.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
A TProcessID identifies a ROOT job in a unique way in time and space.
Int_t IncrementCount()
Increase the reference count to this object.
static TObjArray * GetPIDs()
static: returns array of TProcessIDs
Option_t * GetOption() const
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
Int_t GetErrorCode() const
Returns error code.
TVirtualMutex * fLastUsageMtx
void SetCompressionLevel(Int_t level=ROOT::RCompressionSetting::ELevel::kUseMin)
See comments for function SetCompressionSettings.
void SendStreamerInfos(const TMessage &mess)
Check if TStreamerInfo must be sent.
void SetCompressionAlgorithm(Int_t algorithm=ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
See comments for function SetCompressionSettings.
static ULong64_t GetSocketBytesSent()
Get total number of bytes sent via all sockets.
Bool_t RecvStreamerInfos(TMessage *mess)
Receive a message containing streamer infos.
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
static Int_t GetClientProtocol()
Static method returning supported client protocol.
Bool_t Authenticate(const char *user)
Authenticated the socket with specified user.
TInetAddress fLocalAddress
static ULong64_t fgBytesRecv
virtual void Close(Option_t *opt="")
Close the socket.
void MarkBrokenConnection()
Close the socket and mark as due to a broken connection.
Bool_t RecvProcessIDs(TMessage *mess)
Receive a message containing process ids.
TInetAddress GetInetAddress() const
Int_t GetCompressionLevel() const
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
static ULong64_t fgBytesSent
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
void SendProcessIDs(const TMessage &mess)
Check if TProcessIDs must be sent.
static Int_t fgClientProtocol
virtual TInetAddress GetLocalInetAddress()
Return internet address of local host to which the socket is bound.
TSecContext * fSecContext
virtual Int_t Select(Int_t interest=kRead, Long_t timeout=-1)
Waits for this socket to change status.
virtual Int_t GetLocalPort()
Return the local port # to which the socket is bound.
static TSocket * CreateAuthSocket(const char *user, const char *host, Int_t port, Int_t size=0, Int_t tcpwindowsize=-1, TSocket *s=0, Int_t *err=0)
Creates a socket or a parallel socket and authenticates to the remote server specified in 'url' on re...
static void NetError(const char *where, Int_t error)
Print error string depending on error code.
virtual Int_t SendObject(const TObject *obj, Int_t kind=kMESS_OBJECT)
Send an object.
void SetCompressionSettings(Int_t settings=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault)
Used to specify the compression level and algorithm: settings = 100 * algorithm + level.
virtual Bool_t IsValid() const
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual Bool_t IsAuthenticated() const
static ULong64_t GetSocketBytesRecv()
Get total number of bytes received via all sockets.
Describe Streamer information for one class version.
TObjArray * GetElements() const
void BuildCheck(TFile *file=0, Bool_t load=kTRUE)
Check if built and consistent with the class dictionary.
Int_t GetClassVersion() const
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
TString & Remove(Ssiz_t pos)
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual int GetServiceByName(const char *service)
Get port # of internet service.
virtual TInetAddress GetSockName(int sock)
Get Internet Protocol (IP) address of host and port #.
static void ResetErrno()
Static function resetting system error number.
virtual char * GetServiceByPort(int port)
Get name of internet service.
virtual int SetSockOpt(int sock, int kind, int val)
Set socket option.
virtual TInetAddress GetPeerName(int sock)
Get Internet Protocol (IP) address of remote host and port #.
virtual int OpenConnection(const char *server, int port, int tcpwindowsize=-1, const char *protocol="tcp")
Open a connection to another host.
virtual int GetSockOpt(int sock, int kind, int *val)
Get socket option.
virtual int RecvRaw(int sock, void *buffer, int length, int flag)
Receive exactly length bytes into buffer.
virtual Int_t Select(TList *active, Long_t timeout)
Select on active file descriptors (called by TMonitor).
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
virtual int SendRaw(int sock, const void *buffer, int length, int flag)
Send exactly length bytes from buffer.
virtual void CloseConnection(int sock, Bool_t force=kFALSE)
Close socket connection.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
This class represents a WWW compatible URL.
const char * GetProtocol() const
virtual TSecContext * Authenticate(TSocket *, const char *host, const char *user, Option_t *options)=0
This class implements a mutex interface.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
static constexpr double s
@ kUndefined
Undefined compression algorithm (must be kept the last of the list in case a new algorithm is added).
@ kUseMin
Compression level reserved when we are not sure what to use (1 is for the fastest compression)