24 #include "Compression.h" 56 :
TNamed(addr.GetHostName(), service)
65 if (fService.Contains(
"root"))
67 if (fService.Contains(
"proof"))
78 if (fAddress.GetPort() != -1) {
84 gROOT->GetListOfSockets()->Add(
this);
103 :
TNamed(addr.GetHostName(),
"")
132 gROOT->GetListOfSockets()->Add(
this);
174 gROOT->GetListOfSockets()->Add(
this);
225 gROOT->GetListOfSockets()->Add(
this);
260 gROOT->GetListOfSockets()->Add(
this);
288 gROOT->GetListOfSockets()->Add(
this);
322 gROOT->GetListOfSockets()->Add(
this);
349 gROOT->GetListOfSockets()->Add(
this);
366 gROOT->GetListOfSockets()->Remove(
this);
437 if ((nsent =
Send(mess)) < 0)
456 if ((nsent =
Send(mess)) < 0)
475 if ((nsent =
Send(mess)) < 0)
478 return nsent -
sizeof(
Int_t);
498 Error(
"Send",
"cannot send a message used for reading");
511 const_cast<TMessage&>(mess).SetCompressionSettings(
fCompress);
514 const_cast<TMessage&>(mess).Compress();
516 char *mbuf = mess.
Buffer();
552 if (strncmp(buf,
"ok", 2)) {
553 Error(
"Send",
"bad acknowledgement");
562 return nsent -
sizeof(
UInt_t);
579 if ((nsent =
Send(mess)) < 0)
633 minilist =
new TList();
635 Info(
"SendStreamerInfos",
"sending TStreamerInfo: %s, version = %d",
645 if (
Send(messinfo) < 0)
646 Warning(
"SendStreamerInfos",
"problems sending TStreamerInfo's ...");
663 for (
Int_t ipid = 0; ipid < npids; ipid++) {
677 minilist =
new TList();
679 Info(
"SendProcessIDs",
"sending TProcessID: %s", pid->
GetTitle());
686 if (
Send(messpid) < 0)
687 Warning(
"SendProcessIDs",
"problems sending TProcessID's ...");
704 if ((n =
Recv(str, max, kind)) <= 0) {
713 Error(
"Recv",
"got message of wrong kind (expected %d, got %d)",
733 if ((n =
Recv(mess)) <= 0) {
766 if ((n =
Recv(mess)) <= 0) {
803 if (n == 0 || n == -5) {
814 char *buf =
new char[len+
sizeof(
UInt_t)];
816 if (n == 0 || n == -5) {
841 char ok[2] = {
'o',
'k' };
853 mess->SetWhat(mess->What() & ~
kMESS_ACK);
877 if (length == 0)
return 0;
882 if (n == 0 || n == -5) {
914 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
918 Info(
"RecvStreamerInfos",
"importing TStreamerInfo: %s, version = %d",
928 Bool_t isstl = element && strcmp(
"This",element->
GetName())==0;
932 Info(
"RecvStreamerInfos",
"importing TStreamerInfo: %s, version = %d",
959 TIter nextpid(pidslist);
970 Info(
"RecvProcessIDs",
"importing TProcessID: %s", pid->
GetTitle());
1023 if (algorithm < 0 || algorithm >= ROOT::kUndefinedCompressionAlgorithm) algorithm = 0;
1038 if (level < 0) level = 0;
1039 if (level > 99) level = 99;
1045 if (algorithm >= ROOT::kUndefinedCompressionAlgorithm) algorithm = 0;
1085 err = (err < kErrError) ? ((err > -1) ? err : 0) :
kErrError;
void SetCompressionSettings(Int_t settings=1)
Used to specify the compression level and algorithm: settings = 100 * algorithm + level...
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
Describe Streamer information for one class version.
virtual const char * GetName() const
Returns name of object.
virtual UInt_t GetUniqueID() const
Return the unique object id.
virtual void Close(Option_t *opt="")
Close the socket.
virtual void WriteString(const char *s)
Write string to I/O buffer.
Bool_t RecvStreamerInfos(TMessage *mess)
Receive a message containing streamer infos.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
char * CompBuffer() const
R__EXTERN const char * gRootdErrStr[]
virtual TInetAddress GetLocalInetAddress()
Return internet address of local host to which the socket is bound.
Collectable string class.
const char * GetHostName() const
void SendProcessIDs(const TMessage &mess)
Check if TProcessIDs must be sent.
This class represents a WWW compatible URL.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual Int_t GetEntries() const
This class represents an Internet Protocol (IP) address.
virtual void CloseConnection(int sock, Bool_t force=kFALSE)
Close socket connection.
Bool_t RecvProcessIDs(TMessage *mess)
Receive a message containing process ids.
R__EXTERN TVirtualMutex * gROOTMutex
Int_t GetCompressionLevel() const
TObject * At(Int_t idx) const
virtual TInetAddress GetPeerName(int sock)
Get Internet Protocol (IP) address of remote host and port #.
virtual int SendRaw(int sock, const void *buffer, int length, int flag)
Send exactly length bytes from buffer.
virtual char * GetServiceByPort(int port)
Get name of internet service.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
virtual TObject * ReadObject(const TClass *cl)
Read object from I/O buffer.
static TObjArray * GetPIDs()
static: returns array of TProcessIDs
UShort_t net2host(UShort_t x)
virtual Int_t SetOption(ESockOptions opt, Int_t val)
Set socket options.
void SetCompressionLevel(Int_t level=1)
See comments for function SetCompressionSettings.
static ULong64_t fgBytesRecv
The TNamed class is the base class for all named ROOT classes.
virtual char * ReadString(char *s, Int_t max)
Read string from I/O buffer.
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.
virtual int RecvRaw(int sock, void *buffer, int length, int flag)
Receive exactly length bytes into buffer.
A TProcessID identifies a ROOT job in a unique way in time and space.
Bool_t TestBitNumber(UInt_t bitnumber) const
virtual TInetAddress GetHostByName(const char *server)
Get Internet Protocol (IP) address of host.
virtual Int_t SendObject(const TObject *obj, Int_t kind=kMESS_OBJECT)
Send an object.
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Option_t * GetOption() const
Int_t GetErrorCode() const
Returns error code.
static ULong64_t fgBytesSent
R__EXTERN TSystem * gSystem
virtual Int_t GetLocalPort()
Return the local port # to which the socket is bound.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Int_t IncrementCount()
Increase the reference count to this object.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
TSecContext * fSecContext
virtual TObjLink * FirstLink() const
#define R__LOCKGUARD2(mutex)
virtual int OpenConnection(const char *server, int port, int tcpwindowsize=-1, const char *protocol="tcp")
Open a connection to another host.
virtual int SetSockOpt(int sock, int kind, int val)
Set socket option.
virtual Int_t Select(TList *active, Long_t timeout)
Select on active file descriptors (called by TMonitor).
static ULong64_t GetSocketBytesRecv()
Get total number of bytes received via all sockets.
void SetCompressionAlgorithm(Int_t algorithm=0)
See comments for function SetCompressionSettings.
TObject * UncheckedAt(Int_t i) const
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
TInetAddress fLocalAddress
virtual Int_t Select(Int_t interest=kRead, Long_t timeout=-1)
Waits for this socket to change status.
Wrapper around a TObject so it can be stored in a TList.
Int_t IndexOf(const TObject *obj) const
unsigned long long ULong64_t
virtual Bool_t IsValid() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual TInetAddress GetSockName(int sock)
Get Internet Protocol (IP) address of host and port #.
Int_t GetCompressionLevel() const
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Mother of all ROOT objects.
TObjArray * GetElements() const
TObject * GetObject() const
Int_t GetClassVersion() const
static void NetError(const char *where, Int_t error)
Print error string depending on error code.
void SetLength() const
Set the message length at the beginning of the message buffer.
void BuildCheck(TFile *file=0)
Check if built and consistent with the class dictionary.
virtual int GetServiceByName(const char *service)
Get port # of internet service.
virtual void Add(TObject *obj)
void WriteObject(const TObject *obj)
Write object to message buffer.
Int_t GetEntries() const
Return the number of objects in array (i.e.
static void ResetErrno()
Static function resetting system error number.
Bool_t TestBitNumber(UInt_t bitnumber) const
TVirtualMutex * fLastUsageMtx
void SendStreamerInfos(const TMessage &mess)
Check if TStreamerInfo must be sent.
static ULong64_t GetSocketBytesSent()
Get total number of bytes sent via all sockets.
virtual const char * GetName() const
Returns name of object.
virtual int GetSockOpt(int sock, int kind, int *val)
Get socket option.
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
void SetBitNumber(UInt_t bitnumber, Bool_t value=kTRUE)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual const char * GetTitle() const
Returns title of object.