120 gROOT->GetListOfSockets()->Add(
this);
138 :
TNamed(
addr.GetHostName(),
""), fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
164 gROOT->GetListOfSockets()->Add(
this);
179 :
TNamed(host,
service), fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
203 gROOT->GetListOfSockets()->Add(
this);
222 :
TNamed(
TUrl(
url).GetHost(),
""), fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
251 gROOT->GetListOfSockets()->Add(
this);
263 fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
286 gROOT->GetListOfSockets()->Add(
this);
313 gROOT->GetListOfSockets()->Add(
this);
324 fCompress(
ROOT::RCompressionSetting::EAlgorithm::kUseGlobal)
347 gROOT->GetListOfSockets()->Add(
this);
374 gROOT->GetListOfSockets()->Add(
this);
406 gROOT->GetListOfSockets()->Remove(
this);
512 if (str)
mess.WriteString(str);
537 if (
mess.IsReading()) {
538 Error(
"Send",
"cannot send a message used for reading");
553 if (
mess.GetCompressionLevel() > 0)
558 if (
mess.CompBuffer()) {
591 Error(
"Send",
"bad acknowledgement");
613 mess.WriteObject(obj);
660 if (
mess.fInfos &&
mess.fInfos->GetEntries()) {
672 Info(
"SendStreamerInfos",
"sending TStreamerInfo: %s, version = %d",
673 info->GetName(),
info->GetClassVersion());
683 Warning(
"SendStreamerInfos",
"problems sending TStreamerInfo's ...");
695 if (
mess.TestBitNumber(0)) {
717 Info(
"SendProcessIDs",
"sending TProcessID: %s", pid->
GetTitle());
725 Warning(
"SendProcessIDs",
"problems sending TProcessID's ...");
742 if ((
n =
Recv(str, max, kind)) <= 0) {
751 Error(
"Recv",
"got message of wrong kind (expected %d, got %d)",
782 mess->ReadString(str, max);
841 if (
n == 0 ||
n == -5) {
850 if (
len > (std::numeric_limits<
decltype(
len)>::max() -
sizeof(
decltype(
len)))) {
851 Error(
"Recv",
"Buffer length is %u and %u+sizeof(UInt_t) cannot be represented as an UInt_t.",
len,
len);
856 char *buf =
new char[
len+
sizeof(
UInt_t)];
858 if (
n == 0 ||
n == -5) {
892 const char ok[2] = {
'o',
'k' };
927 if (
length == 0)
return 0;
932 if (
n == 0 ||
n == -5) {
967 Info(
"RecvStreamerInfos",
"importing TStreamerInfo: %s, version = %d",
968 info->GetName(),
info->GetClassVersion());
973 lnk = list->FirstLink();
981 Info(
"RecvStreamerInfos",
"importing TStreamerInfo: %s, version = %d",
982 info->GetName(),
info->GetClassVersion());
1019 Info(
"RecvProcessIDs",
"importing TProcessID: %s", pid->
GetTitle());
1086 if (level < 0) level = 0;
1087 if (level > 99) level = 99;
1136 if (
sproto.Contains(
"sockd")) {
1138 }
else if (
sproto.Contains(
"rootd")) {
1142 Info(
"Authenticate",
"Local protocol: %s",
sproto.Data());
1188 gROOT->GetPluginManager()->FindHandler(
"TVirtualAuth",
alib);
1189 if (!
h ||
h->LoadPlugin() != 0) {
1190 Error(
"Authenticate",
1191 "could not load properly %s authentication plugin",
alib.Data());
1198 Error(
"Authenticate",
"could not instantiate the interface class");
1202 Info(
"Authenticate",
"class for '%s' authentication loaded",
alib.Data());
1205 if (!(
auth->Authenticate(
this, host, user,
opts))) {
1206 Error(
"Authenticate",
1207 "authentication attempt failed for %s@%s", user, host.
Data());
1217 Warning(
"Authenticate",
"problem sending kROOTD_USER (%s,%s)",
u->fUser.Data(), user);
1221 Warning(
"Authenticate",
"problem sending kROOTD_USER (-1,%s)", user);
1227 if (
Recv(stat, kind) > 0) {
1238 Info(
"Authenticate",
"no authentication required remotely");
1244 Info(
"Authenticate",
"expected message type %d, received %d",
1249 Info(
"Authenticate",
"error receiving message");
1309 if (
proto.EndsWith(
"up") ||
proto.EndsWith(
"ug")) {
1313 }
else if (
proto.EndsWith(
"s") ||
proto.EndsWith(
"k") ||
1314 proto.EndsWith(
"g") ||
proto.EndsWith(
"h")) {
1321 if ((
proto.EndsWith(
"p") ||
size > 1) ||
1322 proto.BeginsWith(
"root") ) {
1324 if (
proto.EndsWith(
"p"))
1329 if (!
proto.BeginsWith(
"sock") &&
1330 !
proto.BeginsWith(
"root"))
1351 if (sock && sock->
IsValid()) {
1369 if (
eurl.Contains(
"?"))
1445 if (!user ||
strlen(user) > 0) {
1453 eurl += (port > 0 ? port : 0);
1469 return fgClientProtocol;
UShort_t net2host(UShort_t x)
R__EXTERN const char * gRootdErrStr[]
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
const char Option_t
Option string (const char)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
winID h TVirtualViewer3D TVirtualGLPainter p
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
Int_t gDebug
Global variable setting the debug level. Set to 0 to disable, increase it in steps of 1 to increase t...
TVirtualMutex * gSocketAuthMutex
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD2(mutex)
Bool_t TestBitNumber(UInt_t bitnumber) const
void SetBitNumber(UInt_t bitnumber, Bool_t value=kTRUE)
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
This class represents an Internet Protocol (IP) address.
const char * GetHostName() const
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
void Add(TObject *obj) override
Int_t Compress()
Compress the message.
The TNamed class is the base class for all named ROOT classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
Wrapper around a TObject so it can be stored in a TList.
Collectable string class.
Mother of all ROOT objects.
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.
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.
ROOT::Deprecated::TSecContext * fSecContext
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.
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 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.
static ULong64_t GetSocketBytesRecv()
Get total number of bytes received via all sockets.
Describes a persistent version of a class.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, 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
This class implements a mutex interface.
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 SetSecContext(TSocket &s, TSecContext *ctx)
static Bool_t IsAuthenticated(const TSocket &s)
static TSecContext * GetSecContext(const TSocket &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)