80 :
TNamed(addr.GetHostName(), service),
fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
107 gROOT->GetListOfSockets()->Add(
this);
125 :
TNamed(addr.GetHostName(),
""),
fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
153 gROOT->GetListOfSockets()->Add(
this);
194 gROOT->GetListOfSockets()->Add(
this);
225 if (
fUrl.Contains(
"root"))
227 if (
fUrl.Contains(
"proof"))
244 gROOT->GetListOfSockets()->Add(
this);
268 fName.Form(
"unix:%s", sockpath);
279 gROOT->GetListOfSockets()->Add(
this);
306 gROOT->GetListOfSockets()->Add(
this);
329 fName.Form(
"unix:%s", sockpath);
340 gROOT->GetListOfSockets()->Add(
this);
367 gROOT->GetListOfSockets()->Add(
this);
399 gROOT->GetListOfSockets()->Remove(
this);
453 rc =
gSystem->Select(&fh, timeout);
470 if ((nsent =
Send(mess)) < 0)
489 if ((nsent =
Send(mess)) < 0)
508 if ((nsent =
Send(mess)) < 0)
511 return nsent -
sizeof(
Int_t);
531 Error(
"Send",
"cannot send a message used for reading");
549 char *mbuf = mess.
Buffer();
583 if (strncmp(buf,
"ok", 2)) {
584 Error(
"Send",
"bad acknowledgement");
593 return nsent -
sizeof(
UInt_t);
610 if ((nsent =
Send(mess)) < 0)
663 minilist =
new TList();
665 Info(
"SendStreamerInfos",
"sending TStreamerInfo: %s, version = %d",
675 if (
Send(messinfo) < 0)
676 Warning(
"SendStreamerInfos",
"problems sending TStreamerInfo's ...");
693 for (
Int_t ipid = 0; ipid < npids; ipid++) {
708 minilist =
new TList();
710 Info(
"SendProcessIDs",
"sending TProcessID: %s", pid->
GetTitle());
717 if (
Send(messpid) < 0)
718 Warning(
"SendProcessIDs",
"problems sending TProcessID's ...");
735 if ((
n =
Recv(str, max, kind)) <= 0) {
744 Error(
"Recv",
"got message of wrong kind (expected %d, got %d)",
764 if ((
n =
Recv(mess)) <= 0) {
797 if ((
n =
Recv(mess)) <= 0) {
834 if (
n == 0 ||
n == -5) {
843 if (
len > (std::numeric_limits<
decltype(
len)>::max() -
sizeof(
decltype(
len)))) {
844 Error(
"Recv",
"Buffer length is %u and %u+sizeof(UInt_t) cannot be represented as an UInt_t.",
len,
len);
849 char *buf =
new char[
len+
sizeof(
UInt_t)];
851 if (
n == 0 ||
n == -5) {
875 char ok[2] = {
'o',
'k' };
910 if (
length == 0)
return 0;
915 if (
n == 0 ||
n == -5) {
946 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
950 Info(
"RecvStreamerInfos",
"importing TStreamerInfo: %s, version = %d",
956 lnk = list->FirstLink();
960 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
964 Info(
"RecvStreamerInfos",
"importing TStreamerInfo: %s, version = %d",
991 TIter nextpid(pidslist);
1002 Info(
"RecvProcessIDs",
"importing TProcessID: %s", pid->
GetTitle());
1069 if (level < 0) level = 0;
1070 if (level > 99) level = 99;
1121 }
else if (sproto.
Contains(
"rootd")) {
1123 }
else if (sproto.
Contains(
"proofd")) {
1128 if (!strncasecmp(opt,
"S", 1)) {
1129 if (
Send(
"slave") < 0)
return rc;
1130 }
else if (!strncasecmp(opt,
"M", 1)) {
1131 if (
Send(
"master") < 0)
return rc;
1134 "called by TSlave: unknown option '%c' %s",
1135 opt[0],
" - assuming Slave");
1136 if (
Send(
"slave") < 0)
return rc;
1140 Info(
"Authenticate",
"Local protocol: %s",sproto.
Data());
1186 gROOT->GetPluginManager()->FindHandler(
"TVirtualAuth", alib);
1187 if (!
h ||
h->LoadPlugin() != 0) {
1188 Error(
"Authenticate",
1189 "could not load properly %s authentication plugin", alib.
Data());
1196 Error(
"Authenticate",
"could not instantiate the interface class");
1200 Info(
"Authenticate",
"class for '%s' authentication loaded", alib.
Data());
1204 Error(
"Authenticate",
1205 "authentication attempt failed for %s@%s", user, host.
Data());
1215 Warning(
"Authenticate",
"problem sending kROOTD_USER (%s,%s)", u->
fUser.
Data(), user);
1219 Warning(
"Authenticate",
"problem sending kROOTD_USER (-1,%s)", user);
1225 if (
Recv(stat, kind) > 0) {
1236 Info(
"Authenticate",
"no authentication required remotely");
1242 Info(
"Authenticate",
"expected message type %d, received %d",
1247 Info(
"Authenticate",
"error receiving message");
1312 if (
proto.EndsWith(
"up") ||
proto.EndsWith(
"ug")) {
1316 }
else if (
proto.EndsWith(
"s") ||
proto.EndsWith(
"k") ||
1317 proto.EndsWith(
"g") ||
proto.EndsWith(
"h")) {
1324 if (((
proto.EndsWith(
"p") ||
size > 1) &&
1325 !
proto.BeginsWith(
"proof")) ||
1326 proto.BeginsWith(
"root") ) {
1328 if (
proto.EndsWith(
"p"))
1333 if (!
proto.BeginsWith(
"sock") && !
proto.BeginsWith(
"proof") &&
1334 !
proto.BeginsWith(
"root"))
1349 if (opensock && opensock->
IsValid())
1355 if (sock && sock->
IsValid()) {
1378 if (opensock && opensock->
IsValid())
1449 if (
TString(
TUrl(url).GetProtocol()).Length() > 0) {
1454 if (!user || strlen(user) > 0) {
1462 eurl += (port > 0 ? port : 0);
1464 if (
TString(
TUrl(url).GetOptions()).Length() > 0) {
UShort_t net2host(UShort_t x)
R__EXTERN const char * gRootdErrStr[]
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
unsigned long long ULong64_t
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
TVirtualMutex * gSocketAuthMutex
char * Compress(const char *str)
Remove all blanks from the string str.
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD2(mutex)
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
void Clear(Option_t *option="") override
Remove all objects from the list.
void Add(TObject *obj) override
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 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,...
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Int_t IndexOf(const TObject *obj) const override
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
TObject * UncheckedAt(Int_t i) const
void Add(TObject *obj) override
Wrapper around a TObject so it can be stored in a TList.
TObject * GetObject() const
Collectable string class.
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.
TObject()
TObject constructor.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
This class implements parallel server sockets.
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
This class implements client sockets.
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.
Option_t * GetOption() const override
static TSocket * CreateAuthSocket(const char *user, const char *host, Int_t port, Int_t size=0, Int_t tcpwindowsize=-1, TSocket *s=nullptr, Int_t *err=nullptr)
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.
Describes a persistent version of a class.
Int_t GetClassVersion() const override
Int_t GetNumber() const override
TObjArray * GetElements() const override
void BuildCheck(TFile *file=nullptr, Bool_t load=kTRUE) override
Check if built and consistent with the class dictionary.
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)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
static void ResetErrno()
Static function resetting system error number.
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...
@ 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)